Use your own scripts in Ubuntu

Sometimes tedious tasks can be simplified by writing a simple bash script to perform them. Now i will not go into details on how to write scripts in Bash, but instead show how you can easily make your scripts available from anywhere in your terminal.

First off open up a terminal, and in your home directory create a directory named ‘scripts’. As you might have guessed all your scripts will be placed here. For each script file you place here do the following:

chmod +x

This will ensure that your script is executable, so no more need to type ‘sh’ before running the script. So now you have a directory of executable script, but so far they can only be accessed from either the directory itself, or by typing the path to the script. So we edit our .bashrc file a little. This file is located in your home directory.

gedit .bashrc

Scroll down to the bottom of the file, and add the following line

export PATH=$PATH:/home/USERNAME/scripts/

Of course replace USERNAME with your own username/homedirectory. Now reload the file with

source .bashrc

And you are all set. Any shell script you now place in scripts can be executed from anywhere on the system. The only requirement is to chmod +x on the file first 😀

Take control of your CPU in Ubuntu!

I recently was investigating for no apparent reason if my cpu (core 2 duo) was running at full speed. Also looking for ways to manage speeds, and fan control in Ubuntu. What i found was the following. You can add an applet to your panel that shows the CPU temperature.

Right click on the panel, and choose ‘add to panel’. Choose the CPU Frequency Scaling Monitor.

But how does this help me to control the speed ? It doesn’t, so off i go investigating. But before i did i noticed that instead of showing 1.6 GHz i was getting simply 1. Also i had to add 2 applets to monitor each core.
So after some digging i ran the following command from a terminal:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

What you get from this is a list of the possible frequencies your CPU will run at. The steps are predetermined by the manufacturer. Next is to find a list of the possible managing (called governors) of the speed.

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

This provides me with a list of the Governors available for my cpu. Normally its using the ‘Ondemand’ which allows the higher cpu usage if needed, but else throttles down speeds in exchange for longer battery life and temperature.

Now my goal was to be able to mange them myself also, so i found after some searching that the CPU monitor applet would allow this, but pr default is set not to allow the user to change such setting. It makes sense also because why would be average user (non-root) need to control cpu settings. Also changing it would allow ANY user on the system to change the speeds. Since I’m only myself i don’t mind this. So off i go to reconfigure the applet, to allow speed changing:

sudo dpkg-reconfigure gnome-applets

This is gonna change the settings if you answer yes to the question regarding setting the suid of the cpufreq-selector executable. Now i can right click my cpu monitor applet and under preferences choose which kind of controls i want available. I choose to have both frequency, and governor available.
Now a simple left click on the monitor allows me to change either the governor mode, or the frequency itself.

Hope this helps people take back control of their cpu, or at least leave you the opportunity to do so 😀 Enjoy!

How to get everything you planned done 101

this is the first of a series of articles on how to get your tasks done in reasonable time. There is a lot of long books, articles and I’m sure seminars and such around this subject. How to organize your everyday life ect.

What I’m going to do is simply list my own personal tips on how to kill that TO DO list each day, and how to deal with a busy schedule.

Get a calendar: Getting a calendar is priority number one. Having a central place to know what you will be doing for the rest of the month and more specifically how busy your week will be is essential for having a nice day were you manage to make your deadlines. Personally i suggest getting yourself a nice Google Calendar. Its on line, you can have multiple calendars included. They can easily be shared on a website for people to see whether or not you are busy on a given date. And finally its free ! 😉 After i started using Google calender to input my work schedule along with my university lectures i have had a much better idea of how my week is going to be. About the only functionality i miss with this calendar is the ability to have it off line in some application that would synchronize upon connect and/or with a PD.

The downside. Well if you are stuck without a Internet connection you are boned. You also need a computer of some sorts to add tasks to your calender. But personally i use my laptop every day, and if i get a task outside of daily computer use i make sure to tell the person i will check with my calendar first, and add if it have the time. This allows me to check my schedule for time first, and then add the appointment if i see it fit.

Make TO DO lists: Whether it be written on a piece of paper, or a big blackboard make a TO DO list. I have gotten myself a nice white board at home for use when solving university assignments. this also serves as my general TO DO list. Some tasks don’t have deadlines that are practical to punch into your calendar. Stuff like remembering to buy a new chicken, socks or perhaps the eluding gallon of milk.
Also practical to simply list what tasks need to be done each day. Myself i usually once a day try and go through the list, and see if any of them can fit in with tasks i have in my calendar. Example is that i need to go to the post office. This fits nicely with my task of dropping by work about something, so i make sure to make a note of doing both 😀

If you dont have room, or opportunity to get a white board, a block of A5 paper on the desk works just a well. Simply write stuff you need to remember, and update as you get along. I should mention however that white boards can be bought cheaply now i various sizes, and also made yourself. You only need some dry erase markers and the board can be made of a surface like Plexiglas (local hardware store and ask/try out)… Gonna be making a project in a month of so on how to build a white board yourself for little money.

This concludes my first little article on organizing your life. Next article will deal with handling e-mail and connection your email use to the TO DO list and calendar. Hope your learned something.

Oz Pearlman Interview

Hey guys.

Sorry about the late posting, but i had trouble finding time to edit it a little. There was some noise on the beginning and end (namely me talking), what i wanted to edit out. Of course i had problems each time i tried to edit it 😀

Anyhow here is the ultrashort “interview” i had with Oz Pearlman while he did a lecture i Denmark. I gotta say the lecture was amazing, and i learned alot. He was a cool guy and great about talking during the break, and after the show with pointers and such. The question he answers in the video is basically which magicians inspired him the most personally.


So check out his site, and for newbies in magic i highly reccomend to check out his dvds. Amazing teacher this guy, and great performer! Thanks for the interview Oz !