finding a huge group of files in the current directory older than 30 days and sending them to a gzip’d tar file:
find . -type f -daystart -mtime +30 -name "file*" | tar -c --files-from=- | gzip > file.tar.gz

finding a group of files and deleting them (useful when you can’t do an rm * on a directory because there are a boatload of files in that dir):
find . -exec rm {} \;

helpful, so i thought i’d post them.

-m

Posted in Code/Programming, Geeky Stuff at April 30th, 2008. No Comments.

so i wrote this on a server today hoping to kill off a bunch of duplicated processes that were locked up… as the title states, it worked the first time! i think this will work in most linux distros that have the -ef flag for the ps command:

ps -ef | grep -v grep | grep [runaway process]| awk ‘{print $2}’ | xargs kill -9

in a nutshell, it prints out the process id from the ps command and uses xargs to pipe it to the kill process.

whew! it saved me a ton of typing, so i thought i’d share.

-m

Posted in Code/Programming, Geeky Stuff, Work at April 23rd, 2008. No Comments.

i’m a fan of open source. while it may be as lucrative in creating software in terms of money, i always find myself seeing how much better open source ends up being. while it’s still quite rough around the edges, as the movement is still quite young in my opinion, i believe that open source is getting closer and closer to the types of software we are used to seeing from closed source companies, such as Microsoft.

i use a lot of open source software myself. firefox is my current browser of choice. at work, i like to write code in eclipse. i’ve been an avid fan of the linux operating system, as well as apache as a web server, and LAMP (and its variants) in general. and for instant messaging, i like to use gaim when using multiple screen names/messaging systems. heck, even to keep myself healthy at the computer, i use workrave to make sure i’m not staring at my screen during crazy coding sessions.

now, i’ve been taking guitar lessons for a while now, about half a year i would say… i’ve been learning a lot, and for some reason tonite while i was having myself a crazy practice session, i came up with this thought:

open source is a lot like music

it seems a bit strange at first, but to me it makes sense… despite what the RIAA says, music is very open and free when you look at the core makeup of a song… music and software are all built upon basic building blocks - music has its notes and chords, software its statements and functions (and i suppose objects if you wanted to include that as well). each musician takes those notes and puts them together to his liking… the same is with the developer. every song has elements that can be found in other songs. the same with software.

lately i’ve been learning to play guitar solos… my teacher, donovan, told me that in order to learn how to solo on your own, you listen to other great guitarist’s solo’s, take the style and parts that you like, and make them your own to create your style. i believe this is what is happening in open source now. take the above linked gaim for instance… the people behind that program took what they like about other software, the messaging protocols, and put it together to create their own program. they stripped what they didn’t like, and kept the stuff they thougth was good. the result is a messenger program, that, while not completely unique or new to the computer world, but has its own place in the world of computing much the same way a song has its own place in the world of music. the same can be said about lots of other software, like open office, eclipse, and firefox.

i found this small epiphany very enlightening and exciting for some reason… it’s strange how you start to see how things interconnect sometimes.

i also decided that there doesn’t seem to be too much open source musical software out there… i think what i’d like to do is create an open source music application… there are 2 programs that i’d like to create and maybe possibly merge or integrate together at some point… the first is a program that would aid in learning and memorizing different musical ideas, such as notes in a chord or scale, building and recognizing complex chords, and other such musical things… the next would be to create my own sort of guitar teaching program… i would basically take the lessons i got from mike granat (my first guitar teacher) and donovan, and try to put them in some logical order that would help someone learn the guitar… or, i would build it for donovan to give to any of his other students as compliments to one on one lessons.

i think this would be an awesome way to get my code into the open source community… the only thing that i’m unsure about is building the graphical parts, as it’s been a long time since i’ve done it, and i don’t know how to make it portable to the different platforms… i’m sure if i build it on the GTK framework, it should work on windows and linux, but i’m not sure about mac… we’ll see tho’, i’ll have to do some research and write some documents for each, and my time is stretched thin right now…

if there is anyone out there would like to join me on this, please feel free to hit me up on the comment section and i’ll write you a proper email… while i’m sure there are probably few developers reading this blog, who knows who might show up and find this interesting…

anyways, i think that would be pretty cool to do some programs like that… i could use the practice and would love to learn some new coding tricks.

so yeah, that’s that… go try some open source software, you’ll be surprised at what you’ll find!

-m

Posted in Code/Programming, Geeky Stuff, Music, Software at August 13th, 2006. No Comments.

alright, alright… so i’ve been crazy laggin’, but i’ve wanted to write about this for a while…

check this article… the guy who wrote it, Philip Chu, documents his lessons from MIT, and it made me think about what i learned at UCI… certainly there’s a huge gap here, in terms of academics, rankings, cost, and other such things, but what we both really learned isn’t all that different in the end… aside from the Work Alone thing, Philip’s look at software engineering is pretty close to mine in many ways…

so why such a big deal here… why is it that much harder to get into MIT when you learn the same thing at a state school?? i suppose the same could be said between, say, UCI and Cal State Bakersfield… i suppose there is some sort of distinction between the learning that goes on, but i’m not all that sure since i went to UCI for both undergrad and grad school… i think the point i’m trying to make, for those of us who are in the software engineering field, is that software engineers tend to have a similar view on the task of writing software… and, may i point out, that view is completely different from a programmer’s view of writing software…

one of the things i’ve learned so far in the working world is that programmer’s are a dime a dozen, much like the smart people mentioned in Philip’s article… sometimes it seems like it’s no wonder much of the world’s applications are buggy… aside from the fact that we can’t think of all possible scenarios, sometimes i wonder if that whiz kid “hacker” was hired because he could deliver ahead of schedule or on time… i don’t know if i have any right to say that or even draw that sort of conclusion, i just wonder sometimes…

it just makes me ponder the year ahead… where do i want to be next year?? where will i be in a few months from now?? all i’d really want would be to know that i was on my career track, that i was out there getting myself to where i want to be…

question is now, where do i want to be??

-m

Posted in Code/Programming, Geeky Stuff, Life at February 10th, 2006. No Comments.