Skip to content

Paint Pixels to Screen via Linux FrameBuffer

I was recently struck by a curious idea to take input from /dev/urandom, convert relevant characters to random integers, and use those integers as the rgb/x-y values for pixels to paint onto the screen. I’ve done some research (here on StackOverflow and elsewhere) and many suggest that you can simply wr…

What are the GCC default include directories?

When I compile a very simple source file with gcc I don’t have to specify the path to standard include files such as stdio or stdlib. How does GCC know how to find these files? Does it have the /usr/include path hardwired inside, or it will get the paths from other OS components? Answer In order to figu…

JAR Dependency Resolution from Within /usr/share/java

Can someone please explain how JAR files and the Java class loader make use of /usr/share/java? Is this a special directory that the JVM will perform automatic JAR loading and class lookups in, but no other? For example, if I have x.jar that depends on y.jar. If both jars are in/usr/share/java the dependency,…

using C code to get same info as ifconfig

Is there a way in Linux, using C code, to get the same information that “ifconfig eth0” would return? I’m interested in things like IP address, link status, and MAC address. Here’s sample output from ifconfig: Answer Yes, ifconfig itself is written in C. 🙂 See: http://cvsweb.netbsd.org…

How do I get out of ‘screen’ without typing ‘exit’?

I screen -r’d into a Django server that’s running and I can’t simply Ctrl + C and exit out of it. Are there any alternative ways to get out of screen? Currently, I manually close the tab on my local PC and ssh back in, but that’s becoming tiresome. Answer Ctrl-a d or Ctrl-a Ctrl-d. See…