Skip to content

Tag: linux

Need to automate SSH commands to router

I need to find a way to automate ssh commands to my router. My goal is to make the router restart whenever I run the script from my Java program. I’m having some issues though. First of all, this is the sequence of output I get from my router’s ssh: First I do: which returns: I enter the password,…

how to use git with a package I am distributing

I have been using git for some time now and I feel I have a good handle on it. I did however, build my first small program as a distribution (something with ./configure make and make install) and I want to put it up on github but I am not sure how to exactly go about tracking it. Should I,

ld cannot recognize the options

I’am reading this Tuto, and I’am trying to link the application using this command: ld test.o –o test.bin, the linker doesn’t recognize the -o option : Using ld -help the option -o exist but i don’t understand why I’am getting this problem. This is the linker version. Answer My g…

Quick remote logging system?

I want to be about to quickly insert some logging into some testing using either (Linux) command line or Python. I don’t want to do anything system wide (e.g. re-configuring syslogd). I’ve done something like this before by doing: wget URL/logme?im=module_name&msg=hello_world And then just par…

How to check the OS with automake

I have a project that uses automake to create the configure and all related files (I’m using autoreconf command to make all this stuff). So, I’m trying to set some conditional files to compile when the project is compiling for macOS (OS X), Windows or Linux. But it fails with the following: And th…

ioctl() call resets file descriptor to 0

Consider the following code: This snippet yields this: Why does my file descriptor get reset to 0? The program writes the stuff out to stdout instead of my block device. This should not happen. I expect my file_fd to be non-zero and retain its value. Answer Looks like you smash your stack. Since there are onl…