Let me first state this for the record: I am not a server guy. The closest I’ve ever gotten to compiling my own versions of code is “sudo port install …” So when I decided to teach myself Python (creating simply database interaction, record listings, etc) and kept getting “500 Internal Server Error” messages, I thought I was doomed. I opened up the Apache error log and saw this:
Shell Archives
Fixing Python’s “Python Eggs” Error
MooTools Forge / GitHub Plugin Structure Shell Script
One thing I love about the MooTools Forge is that it requires a strict structure for its plugins i.e. requiring a README.md file, Source directory, etc. I’ve created a shell script that I can run that creates the directory structure and files required to add my plugin to GitHub and then the Forge.
The Shell Script & Usage
The first step is creating the repository at GitHub. Once created at GitHub, I run the script, giving it the name of the plugin and repository (they must be the same):
./newPlugin.sh ScrollSpy
The script itself looks like:
Run PHP Files From the Command Line
I’ve been brushing up on my shell scripting lately. I just got a MacBook and never felt compelled to spend too much time with Cygwin. I’m learning quite a bit now but there are still some tasks that I’d need to accomplish sooner rather than later. I know how to accomplish the task using PHP so I’ve got that to my advantage. What’s awesome is that I can quickly and easily run my PHP files from the command line.
The Shell Script
php doTask.php
I’m not sure whether I consider using PHP instead of a straight shell script as being resourceful or using PHP as a crutch. What are your thoughts?
Automate YouTube Video and MP3 Rips with Bash Shell Scripting
I love listening to music while I code. Listening to music keeps me from getting too frustrated about code that isn’t working (yes, it happens) or frustrations brought on by hosting providers, clients, etc. What I’ll do is listen to Pandora, hear a song I like, look up the song on YouTube, and save the YouTube link in a text file for later listening. Having to go to YouTube every time sucks so I set out to take YouTube videos linked in a text file and download them to my computer in MP3 format.
The Text File
http://www.youtube.com/watch?v=iYtDqHupwrg
One link per line.
Creating Git Aliases
I create shortcuts for everything. I create variables which act as text shortcuts, shortcuts in TextMate to generate CSS/JS/HTML, and bash scripts so I don’t have to type in the same commands over and over again. So why should version control software be any different? I commit and push religiously so I create Git aliases to save myself a few keystrokes.