BITONIC BLOG based on a true story

20Jan/12Off

Helping Pay Off the National Debt…

... pennies at a time. I have no use for pennies (which, by the way, cost 1.79¢ to make and are worth only 1¢). So what more patriotic thing could I do than to donate them to the US Government to help pay off everything they owe.



for the treasury

19Jan/12Off

Fix Suspend on Macbook Pro 8,1 and 8,2

I had been running Linux 3.0.0 for a while using a USB wifi stick since there are no built in drivers for the Macbook Pro's b4331 chipset. It worked well, but it was annoying to carry around the accessory just to connect to the Internet. Linux 3.2.x includes wifi drivers by default now (yay!), but they do not work properly with suspend. Coming out of the suspended state, the drivers fail to reconnect to any network (but appear to be trying to connect indefinitely). To get around this, open the file:

/etc/pm/config.d/default


and add the line:

SUSPEND_MODULES="b43"


Now when the Macbook goes to sleep, it'll automatically "unplug" the appropriate drivers from the kernel, and reinsert them when waking up. That way the driver itself isn't responsible for handling suspend correctly.

15Jan/12Off

Arfa Karim Randhawa

"If you want to do something big in your life, you must remember that shyness is only the mind," she said. "If you think shy, you act shy. If you think confident you act confident. Therefore never let shyness conquer your mind."

- Arfa Karim Randhawa (1995 - 2012)

Afra Karim Randhawa

14Jan/12Off

They say life is a journy

There are two truths I try to keep in mind whenever I start feeling either extreme:

1. There are people who are so much better at programming than me, that I could work my entire life and never be as good as they are right now.

2. There are people who are so much worse at programming than me, that they could work their entire lives and never be as good as I am right now.

Its a continuum, a hill. Feel the gradient, walk uphill.

- noonespecial

25Dec/11Off

Open Letter to sites with annoying interfaces

Dear Web 2.0 companies,

Remember those childhood games where you are given two nearly identical images and your objective was to find some number of subtle differences? Well, I shouldn't have to play that game when I'm using your damn website.

I show here two examples of a common practice that is plaguing the modern web. First, a clipping from a project page on github.com.

 

 

And now the second image:

 

 

See the difference? My question is this: why? That edit button is the only component of the entire page that has a hide-by-default-unless-your-mouse-is-in-a-certain-vertical-and-horizontal-range behavior. And that behavior is just stupid. Is the edit button really that ugly? Is it really detracting from the purpose of the page? Why bother hiding it?

 

My second example is from Google's contact editing page. I want to delete contact bob. Here is the first image:

Where is the delete button?

 

Oh there it is!! Because it was just so obvious that you should click on the contacts name as if you were going to edit it to make some ellipsis (what the hell are those for anyway?) and a trash can appear.

Seriously. Does Google need help locating some space on that page to put the button? Here, let me try:

I'm not a UX designer, but I sincerely believe this practice of hiding buttons and forms unless the user hovers their cursor in exactly the right areas is a case of "just because we can, doesn't mean we should". Except people are doing it anyway, and it's very annoying. So please, I'm tired of playing peek-a-boo with your website.

 

Sincerly,

A user of the internet

 

15Dec/11Off

Detatchable Bash Aliases (ish)

I wanted to be able to launch an Emacs window from a terminal, while giving it a list of arguments (files to open), and also for the Emacs process to detach itself so I could still use the terminal. This proved to be kind of tricky, because it seemed I couldn't have my cake and be able to eat it too. But I finally came up with this:

function emacs() {
    {
        /usr/bin/emacs "$@";
    }&
}

Just drop this in your .bashrc, reload it

$ source ~/.bashrc

and enjoy.

13Dec/11Off

Scumbag Kindle

I have owned a Kindle 3rd generation for nearly a year, and I just now, 353 days later, figured out how to remove a book from the device without plugging it in to a computer and deleting it by hand. How is it possible, you ask, that such a smart and intelligent nerd such as I could not figure out how to do something so simple ? Well, they say a picture is worth a thousand words, so look at this:

 

delete me? no no no, delete _you_!!

winner of the 2010 most misleading interface award

 

Forgive me, almighty Amazon! For I thought FOR SURE that a DELETE button would be the best choice for DELETING something, rather than the go-left button! So what exactly does the delete button do? In the context of the home screen where books are selected, pressing DELETE starts up the SEARCH feature(!). What the ****?

12Dec/11Off

Manually fix WordPress siteurl using MySQL

After moving my server from Austin to Grapevine, I ran into what I think might be a bit of a conceptual bug in the way WordPress handles remembering its own site url. The way it works now is WordPress creates a table called wp_options (if you allowed the default naming scheme when setting up your database, otherwise you should probably know what your tables are called) and stores all sorts of configuration options in there. The two columns we are interested in are option_name and option_value. When my entire website except for wordpress was working, I wanted to see what I had set the siteurl to be, because it was probably wrong. To do this, start up the MySQL client and login as root:

$ mysql -u root -p


Enter your root password. Change to the wordpress database with the command:

mysql> use wordpress;


Again, this is if your databases name is actually wordpress. If you don't know what your wordpress database name is, you can use mysql to show all the existing databases with the command:

mysql> show databases;


For example mine looks like this:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| todo               |
| wordpress          |
+--------------------+
4 rows in set (0.00 sec)

Now that you've selected your wordpress database, we can see what the current value is for our siteurl. (The siteurl is usually something that you configure in /wp-admin but in this case, we can't access any part of the blog because it thinks the site url is something it is not, and therefor cannot connect. herp derp). Run the command:

mysql> select * from wp_options where option_name="siteurl";


You should see something like:

+-----------+---------+-------------+-------------------------+----------+
| option_id | blog_id | option_name | option_value            | autoload |
+-----------+---------+-------------+-------------------------+----------+
|         1 |       0 | siteurl     | http://herpderp/blog    | yes      |
+-----------+---------+-------------+-------------------------+----------+
1 row in set (0.00 sec)


Where the value http://herpderp/blog is the old/incorrect url of the blog. Now we just need to fix it! Knowing the correct url beforehand, run the command:

mysql> update wp_options set option_value="http://correcturl.com/blog/" where option_name="siteurl";

One thing I want to point out in my own example is that the url includes the /blog/ at the end. This is because that's where my wordpress install is relative to my root directory. In other words, my BLOG is located at http://bitonic.org/blog/ , so the /blog/ is included.

Congratulations! Your site should load at least load now. Close out of your mysql client by pressing Ctrl+D at the prompt, or type 'exit':

mysql> exit
Bye

11Dec/11Off

Disable Notifications in Xubuntu 11.10

There are numerous blog posts and forum threads that talk about how to disable notifications in Ubuntu. This is kind of sad, because the only reason those posts exist is that there is no graphical, or "easy" way of disabling notifications. Not to beat a dead horse regarding usability and the utter stupidity of FOSS "designers", but even Windows 7 provides an easy way to turn off those annoying balloon windows. Why can't Ubuntu/ any libnotify using distribution do the same? But if you're using XFCE (perhaps as a part of Xubuntu like me) and you want to disable notifications, you need sudo permissions, a terminal, and this command:

sudo mv /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service.disabled


This is very similar to the way of disabling notifications in regular Ubuntu, it's just that the file that needs to be removed/renamed is different (why!?).

To turn notifications back on, just reverse the arguments of the mv command. That is, run:

sudo mv /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service.disabled /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service

8Dec/11Off

Greatest PS1 for a git user

export PS1='[\[\033[0;35m\]$(hostname) \[\033[0;37m\]\W\[\033[0m\]$(__git_ps1 " (\[\033[0;33m\]%s\[\033[0m\])")]\$ '

(all one line, of course)

And this is what it looks like in action:

this is what ps1 and git can do

This works well for my black and white background terminal color profiles (gotta be prepared with a white color scheme for presentations on projectors where white-on-black doesn't work). But of course the colors can be tweaked by changing the values 0;35m, 0;37m and 0m such that the colors please you. Like most things, a useful color chart can be found on the Arch Wiki.

Obviously this requires git as well as the completion tools. On my debian system these are pre-packaged as git and git-completion respectively. You can download the necessary stuff with the command:

sudo aptitude install git git-completion

 

Tagged as: , , , Comments Off