akash_rawal 3 weeks ago • 100%
You have to practice switching between neovim and other editors.
You have forgotten how to use a normal editor. I am not making it up, it is a real phenomenon. Similar to when SmarterEveryDay learned to ride a backwards bicycle he forgot how to ride a normal bicycle and essentially had to re-learn it. You have to re-learn how to use a normal editor.
akash_rawal 1 month ago • 100%
- It might be a card grabber.
- Don't put real card details of course.
akash_rawal 1 month ago • 100%
It wants you to put dummy details as fast as you can.
akash_rawal 1 month ago • 100%
It is a game, but it might also be a card grabber.
akash_rawal 1 month ago • 100%
I did not make this, and you're supposed to put dummy details there. Don't put actual credit card information.
akash_rawal 1 month ago • 100%
Thanks man, my brain was short-circuited on Testcontainers so I couldn't write better. Also I am stealing the title.
akash_rawal 1 month ago • 100%
I don't get it, how would a database container run your unit tests? And unless you know some secret option to stop the database after, say, it is idle for a few seconds, it will continue running.
The purpose is to test database dependent code by spinning up a real database and run your code against that.
akash_rawal 2 months ago • 100%
For me the value of podman is how easily it works without root. Just install and run, no need for sudo or adding myself to docker group.
I use it for testing and dev work, not for running any services.
akash_rawal 2 months ago • 100%
It's the same picture.
akash_rawal 2 months ago • 100%
Here you go
akash_rawal 2 months ago • 100%
Yes it is the ratings on winehq, https://appdb.winehq.org/
And yes, an average user probably going to fire a game, figure out it is not working, and promptly go back to windows, which makes that data less accurate, but what can we do about it?
akash_rawal 2 months ago • 100%
The left axis is total number of ratings of each type (Garbage, Bronze, Silver, Gold, Platinum) in a given month (not per app). For example for month 2016-07
there were
"Garbage" => 22
"Bronze" => 14
"Silver" => 13
"Gold" => 55
"Platinum" => 61
On right side is the average rating. So if I assign values to each rating:
"Garbage" => 1
"Bronze" => 2
"Silver" => 3
"Gold" => 4
"Platinum" => 5
I can get an average rating, which will be between 1 to 5.
((22*1) + (14*2) + (13*3) + (55*4) + (61*5)) / (22 + 14 + 13 + 55 + 61)
~= 3.721
I took each rating for games on Wine Application Database, mapped them to numbers (Garbage -> 1, Bronze -> 2, Silver -> 3, Gold -> 4, Platinum -> 5) and plotted a monthly average.
akash_rawal 2 months ago • 100%
No... too hard.
akash_rawal 2 months ago • 100%
npm ruin dev
running shittier could be a nice prank... depending on how often it gets typed.
akash_rawal 4 months ago • 100%
That advertisement would be interpreted as Node C
's advertisement.
The plan is to treat public keys as node's identity and trust mechanism similar to OpenPGP (e.g. include any node key signed by a master key as a cluster member)
Right now, none of the encryption part is done and it is not a priority right now. I need to first implement transitive node detection, actually forward packets between nodes, some way to store and manage routes, and then trust and encryption mechanisms before I'd dare to test this stuff on a real network.
akash_rawal 4 months ago • 100%
The UI is desktop only for now, I'll make the mobile UI some day.
akash_rawal 5 months ago • 100%
I didn't know the answer either, but usually you can compose solution from solutions of smaller problems.
solution(0): There are no disks. Nothing to do. solution(n): Let's see if I can use solution(n-1) here. I'll use solution(n-1) to move all but last disk A->B, just need to rename the pins. Then move the largest disk A->C. Then use solution(n-1) to move disks B->C by renaming the pins. There we go, we have a stack based solution running in exponential time.
It's one of the easiest problem in algorithm design, but running the solution by hand would give you a PTSD.
akash_rawal 5 months ago • 100%
Replacing "Programmers:" with "Program:" is more accurate.
::: spoiler spoiler Tower of Hanoi is actually easy to write program for. Executing it on the other hand... :::
akash_rawal 5 months ago • 100%
Technically, containers always run in Linux. (Even on windows/OS X; on those platforms docker runs a lightweight Linux VM that then runs your containers.)
And I wasn't even using Docker.
akash_rawal 5 months ago • 100%
How I lost a Postgres database:
- Installed Postgres container without configuring a volume
- Made a mental note that I need to configure a volume
- After a few days of usage, restarted the container to configure the volume
- ...
- Acceptance
akash_rawal 5 months ago • 100%
akash_rawal 7 months ago • 100%
I don't know either, but from what I know, bureaucracy and corruption is often a result of bad organizational structure. Some "designated officer" raises a finger which gets approved by the Secretary who is appointed by the minister who is appointed by the PM who is nominated by the Lok Sabha, and we lose yet another privacy protecting service. I think we should have more direct control in these matters.
For now, if we cannot expect a proper functioning web, they cannot expect stability under their seats. Vote them out.
akash_rawal 7 months ago • 100%
They never will, we have to vote them out.
akash_rawal 7 months ago • 100%
Just did some basic testing on broadcast addresses using socat, broadcast is not working at all with /32 addresses. With /24 addresses, broadcast only reaches nodes that share a subnet. Nodes that don't share the subnet aren't reachable by broadcast even when they're reachable via unicast.
Edit1: Did more testing, it seems like broadcast traffic ignores routing tables.
On 192.168.0.2, I am running socat -u udp-recv:8000,reuseaddr -
to print UDP messages.
Case 1: add 192.168.0.1/24
# ip addr add 192.168.0.1/24 dev eth0
# # Testing unicast
# socat - udp-sendto:192.168.0.2:8000 <<< "Message"
# # Worked
# socat - udp-sendto:192.168.0.255:8000,broadcast <<< "Message"
# # Worked
Case 2: Same as above but delete 192.168.0.0/24 route
# ip addr add 192.168.0.1/24 dev eth0
# ip route del 192.168.0.0/24 dev eth0
# # Testing unicast
# socat - udp-sendto:192.168.0.2:8000 <<< "Message"
2024/02/13 22:00:23 socat[90844] E sendto(5, 0x5d3cdaa2b000, 8, 0, AF=2 192.168.0.2:8000, 16): Network is unreachable
# # Testing broadcast
# socat - udp-sendto:192.168.0.255:8000,broadcast <<< "Message"
# # Worked
I was exploring direct links between machines, and basically failed to break something. I assigned IP address `192.168.0.1/24` to `eth0` in two ways. A. Adding `192.168.0.1/24` as usual ``` # ip addr add 192.168.0.1/24 dev eth0 # ping -c 1 192.168.0.2 PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data. 64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.051 ms --- 192.168.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.051/0.051/0.051/0.000 ms # ``` B: Adding `192.168.0.1/32` and adding a /24 route ``` # ip addr add 192.168.0.1/32 dev eth0 # # 192.168.0.2 should not be reachable. # ping -c 1 192.168.0.2 ping: connect: Network is unreachable # # But after adding a route, it is. # ip route add 192.168.0.0/24 dev eth0 # ping -c 1 192.168.0.2 PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data. 64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.053 ms --- 192.168.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.053/0.053/0.053/0.000 ms # ``` Does this mean that adding an IP address with prefix is just a shorthand for adding the IP address with /32 prefix and adding a route afterwards? That is, does the prefix length has no meaning and the real work is done by the route entries? Or is there any functional difference between the two methods? Here is another case, these two nodes can reach each other via direct connection (no router in between) but don't share a subnet. Node 1: ``` # ip addr add 192.168.0.1/24 dev eth0 # ip route add 192.168.1.0/24 dev eth0 # # Finish the config on Node B # nc 192.168.1.1 8080 <<< "Message from 192.168.0.1" Response from 192.168.1.1 ``` Node 2: ``` # ip addr add 192.168.1.1/24 dev eth0 # ip route add 192.168.0.0/24 dev eth0 # # Finish the config on Node A # nc -l 0.0.0.0 8080 <<< "Response from 192.168.1.1" Message from 192.168.0.1 ```
akash_rawal 7 months ago • 75%
Here is a trick that has been tried and tested over the years: Install another distro, and use that to install Arch. This way, you can rely on an already working linux distro till your Arch install works the way you want.
akash_rawal 8 months ago • 100%
Hmm... Maybe I should adjust my priorities.
akash_rawal 8 months ago • 95%
I was confused for a moment, because intuitively a CPU fan would look in the same direction as it blows air, so it should look into the heatsink. The fan looking away from the heatsink seems weird to me.
Or the owner installed the fan in the wrong direction.
akash_rawal 9 months ago • 100%
I was thinking along the lines of
Plenty of libraries can build the XML using structs/classes. e.g. with serde:
//Data type for row
#[derive(serde::Serialize)]
pub struct Foo {
pub status: String,
pub name: String,
}
//Example row
let ent = Foo {
status: "paid".into(),
name: "bob".into(),
}
//Example execution
sqlx::query(&serde_xml_rs::to_string(&InsertStmt{
table: "foo".into(),
value: &ent,
})?).execute(&conn)?;
Or with jackson-dataformat-xml:
//Data type for row
public class Foo {
public string status;
public string name;
}
//Example row
Foo ent = new Foo();
foo.status = "paid";
foo.value = "bob";
//Example execution
XmlMapper xmlMapper = new XmlMapper();
String xml = xmlMapper.writeValueAsString(new InsertStmt("foo", ent));
try (Statement stmt = conn.createStatement()) {
stmt.executeUpdate(xml)
}
I don't do JS (yet) but maybe JSX could also do similar things with XML queries.
No more matching $1, $2, ... (or ?
for mysql) with individual columns, I could dump entire structs/objects into a query and it would work.
akash_rawal 9 months ago • 75%
1 a : to propel oneself in water by natural means (such as movements of the limbs, fins, or tail) b : to play in the water (as at a beach or swimming pool) 2 : to move with a motion like that of swimming : glide a cloud swam slowly across the moon 3 a : to float on a liquid : not sink b : to surmount difficulties : not go under sink or swim, live or die, survive or perish— Daniel Webster 4 : to become immersed in or flooded with or as if with a liquid potatoes swimming in gravy 5 : to have a floating or reeling appearance or sensation
https://www.merriam-webster.com/dictionary/swim
Apparently, swimming inherently requires a liquid.
akash_rawal 9 months ago • 66%
Better than parameterized queries. Yes, we have stuff like query("INSERT INTO table(status, name) VALUES ($1, $2);").bind(ent.status).bind(ent.name).execute...
, but that's kind of awful isn't it?
With XML queries, we could use any of the XML libraries we have to create and manipulate XML queries without risking 'XML injection'. e.g we could convert ordinary structs/classes into column values automatically without having to use any ORM.
akash_rawal 9 months ago • 95%
I actually like this. This would allow reuse of all the infrastructure we have around XML. No more SQL injection and dealing with query parameters? Sign me up!
akash_rawal 9 months ago • 100%
We can say default is and
and add an Or
node for or
. Similar to SoP notation, you only write +
.
akash_rawal 9 months ago • 100%
TPM stores the encryption key against secure boot. That way, if attacker disables/alters secure boot then TPM won't unseal the key. I use clevis to decrypt the drive.
akash_rawal 9 months ago • 100%
Thank you... I had to learn kubernetes for work and it was around 2 weeks of time investment and then I figured out I could use it to fix my docker-compose pains at home.
If you run a lot of services, I can attest that kubernetes is definitely not overkill, it is a good tool for managing complexity. I have 8 services on a single-node kubernetes and I like how I can manage configuration for each service independent of each other and also the underlying infrastructure.
akash_rawal 9 months ago • 100%
don't create one network with Gitlab, Redmine and OpenLDAP - do two, one with Gitlab and OpenLDAP, and one with Redmine and OpenLDAP.
This was the setup I had, but now I am already using kubernetes with no intention to switch back.
akash_rawal 9 months ago • 100%
I was writing my own compose files, but see my response to a sibling comment for the issue I had.
akash_rawal 9 months ago • 100%
If one service needs to connect to another service then I have to add a shared network between them. In that case, the services essentially shared a common namespace regarding DNS. DNS resolution would routinely leak from one service to another and cause outages, e.g if I connect Gitlab container and Redmine container with OpenLDAP container then sometimes Redmine's nginx container would access Gitlab container instead of Redmine container and Gitlab container would access Redmine's DB instead of its own DB.
I maintained some workarounds, like starting Gitlab after starting Redmine would work fine but starting them other way round would have this issue. But switching to Kubernetes and replacing the cross-service connections with network policies solved the issue for me.
akash_rawal 9 months ago • 100%
Nothing will ever top "Galaxy Note 7". Super fun in planes, especially if they're flying.
akash_rawal 9 months ago • 33%
As someone who is operating kubernetes for 2 years in my home server, using containers is much more maintainable compared to installing everything directly on the server.
I tried using docker-compose first to manage my services. It works well for 2-3 services, but as the number of services grew they started to interfere with each other, at that point I switched to kubernetes.
akash_rawal 9 months ago • 100%
All these are just silly stereotypes that almost nobody fits into.
I am building my personal private cloud. I am considering using second hand dell optiplexes as worker nodes, but they only have 1 NIC and I'd need a contraption like this for my redundant network. Then this wish came to my mind. Theoretically, such a one box solution could be faster than gigabit too.
Let alone including yourself in the picture. I know how you look like. Let alone including your loved ones in the picture. Even when their disappointment of having to face away from the monument is clearly visible in the photo. And then you make them do stuff like 'hold the sun in your hands' or whatever.