Details
-
AboutI like fixing segfaults
-
Skillscertu lonu gletu lodo mamta
-
Locationma Masina
-
Website
-
Github
Joined devRant on 11/6/2016
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
So i'm trying to upload a file to an SSH server using node. First I try the obvious putFile method provided by the obvious node-ssh package. On any other server this would work fine but this server doesn't have sftp installed so that doesn't work.
OK, so next I learn how scp works (it runs the command "scp -t" on the remote server, and sends to stdin a command like "C0666 1234 file.txt" and then sends the contents of the file) and I write some javascript code to do this. It's pretty finicky, the first few tries I forget to close the stream right or detect the program finishing. I add some logging and that helps me figure out what the problem is, and finally I get it to not output any errors.
So I log into the server and check and the file isn't there. I try again several times, file still isn't there. I try running scp -t manually on the server, typing in exactly what my program is sending, and it works. This goes on for a while until I realize that I've been sending a file to one server and logging into a different server to check if the file was sent. grrr6 -
uBlock Origin hides the ++ buttons because they have a class of `plusone` and plus one is a tracking company. sigh...3
-
Finally I have a nice round number of points!
(please don't upvote unless you have 1000000000 friends who will upvote as well)4 -
There's no way to subscribe to a user on the desktop app, and I don't have a phone. Anyone know how to do this by manually sending an http request?2
-
Confluence. Somehow they decided it was a good idea to remove the markup editor, and now your can only use the WYSIWYG editor. WYSIWYG editors suck. So I have to memorize a crap ton of keyboard shortcuts instead of just writing confluence markup which was apparently very similar to markdown. Argh5
-
Story time! This happened several years ago, back when I didn't have a computer and I was just using the computers at the university. They had 8 iMacs all in a row, and I would sign into one and do my work.
Now these computers have Deep Freeze on them, which is a fancy hard disk driver that treats the entire drive as copy-on-write, so when anything writes to the drive it makes a copy of the block and writes to that instead. That way all your changes are gone when you reboot. It's a real nifty idea, but it's annoying that you have to reset all your settings the way you like them.
So as part of my setup routine I signed into iCloud. This automatically synced my browser history and my email, and various other things I didn't really care about.
One of those things I didn't care about was Find My Mac. I found this out next time I signed into iCloud and saw the university computer on the list. I had never seen these computers on the list before since normally the computer reboots and forgets everything when you log out. What I think happened is the sysadmin forgot to check the "reboot on logout" option in Deep Freeze. So I was like "I wonder what would happen if I passcode locked the computer?" I clicked the passcode lock option and entered 5555, and it seemed to work.
The next day I come in and the particular computer I locked was gone. I thought "oh God what have I done". So I inquired with the sysadmin (who I really hope is not reading this) and he said "oh, someone got into the Find my Mac thing and locked it down. We were trying different codes, since if we couldn't unlock it we'd have to send it to Apple and provide proof of purchase and that could take weeks. We had tried all the obvious ones like 1234 and that wasn't working so I was about to give up, but then I tried 5555 and it rebooted! So yeah, it'll be back soon, and I decided to try installing OS X 10.11 on it because we'll all need to upgrade sooner or later eventually and it's best to have tested a bit first."
So in the end I somehow made it out with my skin still on, and also with El Capitan on one of the computers, which was the only one I used after that. Not so bad! Oh and if you've manged to read all the way through you deserve a cookie 🍪😄1 -
The index to Sedgewick's Algorithms book says:
recursion, 35
see also base case,
see also recursion1 -
double RandDouble(double min, double max) {
double rand = (double) RandomGen::GetRand32() / UINT32_MAX;
return (rand * (max - min)) + min;
}
I wrote this function 2 months ago and until now assumed it was working.
Turns out GetRand32 has a range up to INT32_MAX, not UINT32_MAX. So this function would only ever select the first half of the range.
You gotta be fucking kidding me... -
Found in kernel/sched.c in Linux 1.2:
The "confuse_gcc" goto is used only to get better assembly code..
Dijkstra probably hates me.
https://git.kernel.org/pub/scm/...3 -
Why does there have to be both dup(fd) and fcntl(fd, F_DUPFD)? As far as I can tell they do exactly the same thing, one just looks more complicated than the other.
-
Was watching a dev stream on twitch and noticed the following code on screen:
if (blah blah blah) {
int fuck = 0;
mysql_blah_blah(blah, blah, &fuck);
} -
I'm on the devRant web app, and all the ++ buttons have
style="display: none !important"
WHAT
(of course, -- works fine)2 -
The guy Intel hired to come up with instruction mnemonics must be just letting his cat walk over the keyboard every time he needs a new idea.
cvttps2dq? sounds good!