Shell scripts and planned projects

I’m working on a script to automate the setup I go through for new Debian VMs. Debian is my favorite Linux distro so far; I’ve tried out a good handful, but by no means all of them, or even all the common ones.

I also like GNOME 3. Not a terribly popular opinion, I’m aware. I know GNOME 3 is not the fastest or leanest interface out there, but it is shiny and reminds me a bit of Mac OS X and I like it. (Implied: for desktop use. If you’re using Debian for servers you should be using the command line.)

I’m pretty sure I have an old shell script around here somewhere that has an example of the next thing I have to do in this script, which involves sed and is a pain. I’m trying to grab the kernel version from the output of uname -a, which is formatted roughly as #.#.#-[stuff]. I just want to get sed to work on some variables–find the string I want out of one variable and stick it in the other–but sed and variables in scripts looks complicated so I’m kind of putting it off. I don’t really want to use files for this because then you have to name them and delete them afterwards and that could cause problems. Also, trimming things based on whitespace isn’t going to work; uname -a says the kernel version is the fourth output argument but I tested it and it’s the third on my system.

Anyway, this is taking longer than I thought it would. I’m doing this because I plan to use Debian VMs as test machines for other projects, and I want to make them efficiently… and because it’d be a nice addition to my tutorial on making VMs if I stuck it on GitHub.

#Disclaimer included for my greener readers
I want to stress that if you download this kind of script from GitHub, you better bloody know what it’s doing before you run it–or at least you should be running it only on a VM you don’t mind blowing away. Especially if you have to be root to run it.

I’ve really got to get going on my schoolwork and should probably be writing papers instead of scripts. The first one took longer than I thought it would. I’m doing my next on Django, I think. I don’t know much about Django, but I’ve been considering learning it for the job site I’ve been kind of designing in the back of my head for a month or so.

I know Rails is really popular too, but I’m considering Django over it for two reasons.

  1. I know Python but not Ruby. This wouldn’t be enough to steer me away if it weren’t for…
  2. Rails, from my reading, does more magic automation than Python, and it sounds like maybe the automation includes some stuff I’ve struggled with. I need to get over that. So it sounds like Rails is a tool for when I’m a better developer than I am.

Rails does have a bigger dev community, though, so I may yet change my mind. I’m just not sure about how much I want to learn a new framework and a new language at the same time, even if both are well-designed. I’m still relatively green at programming, in the grand scheme of things.

I’ve also still got my mind on the idea of a dev-setup program for newbie coders. This script I’m making is kind of a training run for me on shell scripting, although I’m thinking about poking my nose into how to use Python for the things I’m using shell scripts to do. The GUI and script builder will of course be written in Python/Kivy, because I know those and they’ll actually be really good tools for this. I kind of want the program itself to be beginner-readable. Not just the shell scripts but the script builder. Maybe it’ll end up being the first open source project someone contributes to. (Apart from being the first big open source thing I make. The only thing on my GitHub right now is tinypapers, and it’s not even posted correctly. I haven’t gotten around to sorting out the timeline.)

I do feel a little regret over abandoning tinypapers, but not for the obvious reason. I don’t feel bad about leaving it behind, I just think you guys were kind of invested in it? Like, a lot of people seemed to be really enjoying following its progress. That’s just how it goes sometimes, though. “Plan to throw one away; you will, anyhow.” I could finish it… but I could also go on and create something else that hasn’t already been invented. Don’t worry, I’ll get back into a real project once I tie up some loose ends here.

One more weird idea for the night. This idea has been in the back of my mind for a while, and it’s so bizarre that I’m not even sure where to start with it. You know how fast food restaurants always sound kinda like hospital rooms because all the equipment is beeping all the time? It’s really annoying. Sometimes it’s really loud. But the cooks and so on need to know that this beeping noise means the fries are done, this beeping noise means the cappuccinos are ready, etc, etc. I had this idea that you should replace all the different beeping noises made by the different machines with jazz instruments.

Yeah… hear me out.

You’d have one metronome on the network and then each machine would get assigned an instrument. There seems to be one machine that’s constantly beeping, right? It gets the bass. When the fries are done, instead of beeping, they just add a saxophone sound to the bass. When the coffee is ready, it throws in violin. And then when the microwave goes off it lets the world know with a harmonica sound.

This would make fast food work so much more relaxing, right? Not to mention eating there.

Jazz works because it’s unstructured. You still follow the beat, but apart from that, nothing will raise red flags. You need a decent library of musical loops, some machinery to test things on, a fast private WiFi network, and a central Raspberry Pi or something (in a really good case, to shield it from the grease).

I’m not sure how well this would work as a startup idea. The different machinery each chain uses is kind of a serious trade secret, and it’s expensive. You’d either have to have influence with the people manufacturing the machinery, or a blind fast-food manager who doesn’t notice that you’re hacking around with the machines before you lock up.

My mom pointed out that maybe this would find a nobler purpose in actual hospital rooms, where jazz music would be a lot less stressful on patients than all the beeping. I have to admit it’s a good idea… although it might make some people hate jazz by association, and I’m not sure how much the staff relies on the specific noises the machines make. *shrug* It runs into the same problem, though: medical equipment to tinker with is expensive. I’m not sure how you could break into the idea.

That’s it for the night, guys. I have a little bit of a feeling that once I publish this post, people are going to start giving me suggestions in the comments on the script I’m writing. And I welcome that! Once I spew out a crappy untested v1, though, I’ll stick it up on GitHub (covered in warnings) so smarter people can tell me what I’m doing wrong more easily. XD

Advertisements

One thought on “Shell scripts and planned projects

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s