Stream of Ry

Yet Another Geek In The World

Archive for the ‘linux’ tag

Concatenating images with montage

leave a comment

To concatenate multiple images vertically:
montage image1.png image2.png -mode Concatenate -tile 1x output.png

To concatenate them horizontally, just change the -tile 1x to -tile x1

You can check more use cases here or RTFM here. :)

Written by rystraum

August 19th, 2011 at 2:52 pm

Posted in Software

Tagged with , ,

Mounting remote directories via sshfs

leave a comment

I’ve had the (dis)pleasure of having to actually code on a Mac. The shortcut keys are too much of an interruption to code comfortably. OTOH, I need the Mac to compile via XCode.

Necessity is the mother of innovation, they say, so I searched around and stumbled upon SSHFS.

Installation was straightforward. On my Ubuntu 10.10:
sudo apt-get install sshfs

Adding myself to the fuse group:
sudo adduser me fuse

And then mount via CLI as follows:
sshfs me@remoteip:/Users/developer/Desktop ~/local/mountpoint

It’s now looks like any other directory you have in your system, albeit with a bit of minor lag. Then I code using my two monitors, and with all the Linux goodness I want. I’ve set up a blank key pair on my local and the remote machine so it doesn’t ask me for passwords anymore.

Laziness is truly such a virtue.

If you encounter other problems, this was the article I followed the first time around.

Written by rystraum

July 6th, 2011 at 11:10 am

Posted in Software

Tagged with , ,

Cory Doctorow : Little Brother

2 comments

I’ve posted this on the UnPLUG mailing list and thought that maybe some other geeks would be interested in this:

———————- Start cross post —————-

Hi guys and gal,

Link: http://craphound.com/littlebrother/Cory_Doctorow_-_Little_Brother.htm

Found a “science-fiction” book (surprisingly, Creative Commons) that explores the same
theme as George Orwell’s 1984 book. Dito nga lang, ang bida ay a 17 y.o. hacker at
magiging instrumental ang Linux sa story (I think. Chapter 6 palang ako eh. XD)

Good luck sa atin sa Halalan mamaya. :)
Be awesome. :D

Rystraum F. Gamonez

—————- End cross post ————–

Other download-able formats are available here (thanks JM!)

I’ve since finished the book (finished it in one sitting) and if you ever were a computer geek like us, I’m pretty sure you’d enjoy the extra bits of tech you’d learn here. I would daresay that people who are interested in computer / system security should read this book. :D

Written by rystraum

February 20th, 2011 at 4:19 pm

Posted in Personal

Tagged with , ,

How I’ve learned Linux (and a lot of other stuff)

leave a comment

First, read (any or all of) the following sites:
Paul Graham’s Good and Bad Procrastination
Structured Procrastination
Procrastination and Perfectionism

Okay. So, you’ve probably “wasted” a good 15 to 20 minutes of your time but by “wasting” your time reading those 3 articles, you’ve learned about procrastination. Which, by the way, was what you just did.

I procrastinate by spending a lot of time reading about technology, hanging out in the Ubuntu IRC, making something work in Linux, writing random applications, learning some random framework I read about in Wikipedia 5 minutes ago or pretty much exploring my system instead of studying for that next exam, actually doing that homework or advanced reading on the subjects.

It’s done me a lot of good so far. Sure, my school performance wasn’t really the best around (I get by) but on the side, I’ve learned about 101 things more practical than school-based theory. Sure, I may not be an *expert* in these things but at least I know these things exist and later on it gives me a wider perspective and eventually reveals a lot of possibilities. Possibilities such as Linux and FOSS.

As a friend (and co-procrastinator) put it: “[P]rocrastination taught me Linux. [...] I’d make that a facebook status, but I’d rather not tell that to my employer XD” — thus I did not name him in this post. His employer might find out.

Every hour spent on a craft is an hour closer to the magic 10,000 hours mark whether through procrastination or deliberate practice. It’s an hour closer for being a master.
I bet the experts were probably as much as a procrastinator/crammer/slack off as your average person. It’s what they do as an “excuse” from doing what they’re supposed to do that sets them apart.

Written by rystraum

August 6th, 2010 at 12:12 pm

Posted in Personal

Tagged with , , ,

Linux startup process from 30k-feet high

leave a comment

Here’s a nice explanation of the (Debian) boot process (from the Debian Administration)

There are a lot of misconceptions voiced here about the sysvinit system. It is complex because it HAS to be. To quote Eistein, “Make things as simple as possible, and no simpler.”

Sysvinit is the best way known to manage all the complexity involved in making any combination of the 10,000+ Debian packages load the various daemons they need, in the order they need, only to the extent they are installed, and have them all work smoothly together. The older BSD init system was simpler, but less capable– the init scripts had to be edited for every package you added that needed to start at boot time, and the order was always a potential source of a problem. That is why most Linux distributions use sysvinit– it has proven its value over many years.

Each package that needs to load at a certain runlevel puts one script in /etc/init.d, usually named with the package name. This allows you to start, stop, restart, reload, etc. it by typing “/etc/init.d/mypackage start” (or stop or reload or whatever). If you write a script, use others as a template, and change what you need to change. Test the script by typing these commands manually (probably at a root shell). If the script works properly here, it should work in runlevels. However, to answer the last plea for help, this script does NOT start anything automatically at ANY runlevel. We still need one more thing for that.

To do that, we create symlinks to these scripts in the various runlevel directories. For example, if we normally run at runlevel 2 (as Debian does by default) and we want mypackage to run as start, then create two links in /etc/rc2.d, one named S99mypackage and one named K99mypackage. S means Start, and K means Kill (stop) the process. When the system goes into runlevel 2, all the start links in /etc/rc2.d will be run one after another. The 99 tells the system WHEN it should be run– they run in numerical order from 01-99 (and in alpha order within those numeric levels, I think). So 99 will be run last, and everything should basically already be up by then, usually a good choice for your personal stuff. But if you want it run before thing1 and after thing2, then pick a more appropriate number. If you want it started first and stopped last, then name the links S01mypackage and K99mypackage. You can also disable the link temporarily by renaming the uppercase S or K to lowercase– only the uppercase letters will be run.

As to “why so many runlevels, if Debian only uses two?”– you can use them any way you want. Runlevel S (or 1) is single-user maintenance mode (which may not even mount your disks). Runlevel 2 (in Debian) is multi-user. Some distributions once used runlevel 3 for networking, or 5 for X windows. Now both (networking and X) seem to be nearly universal, and are not usually put on separate runlevels. But if you want to do that, you can. It’s your system, do what you want. Maybe you have a system needs to be configured differently at home and work, or when the kids are using it. You can set runlevels for these different modes.

If you want the simpler “just run this at boot time” of BSD, just add your script to the /etc/rc.local script which runs after the rest of the boot process is complete. So you CAN have it both ways.

Hope this clears up some of the confusion. I’d say RTFM, but sometimes the manuals are long on detail and short on 30,000 foot-level explanation of the concepts.

Written by rystraum

July 6th, 2010 at 6:10 pm