Ivor O’Connor

January 28, 2010

Why Ubuntu Sucks: Part V

Filed under: Uncategorized — ioconnor @ 12:44 am

I was tracking down the printing bug that has been around like forever. Since Ubuntu version 5 or 6. It’s the one that prevents Ubuntu from printing a PDF or if it does print it may take 30 minutes. The bug can be found here on their bugs.launchpad. This time around people are actually taking it seriously. Noticing how it will tie up 100% of both CPUs in a dual CPU machine and hang. Notice how the very first sentence is:

This bug report will be marked for expiration in 58 days if no further activity occurs.

So if they don’t fix it in this iteration they’ll continue to mark the Brother printers as fully compatible as they have in the past.

Once again the whole problem with Ubuntu is practically nothing works 100%.

January 25, 2010

Give a man a fish, make it illegal to teach fishing.

Filed under: Uncategorized — ioconnor @ 7:28 pm

“Give a man a fish and he eats for a day. Teach him to fish and he eats for a lifetime.”

It seems this is the dividing line between individuals and corporations. Corporations want monopolies. They think “Allow a man to learn how to fish, and you can no longer sell him a fish a day” and do everything in their power to prevent individuals from learning to fish. Making it illegal in many many fields.

Now that I think of it most pro-bono humanitarian aid is an attempt to keep the individuals from learning how to fish. Give them fish so they can become working slaves for life…

Just say no…

Navigating Log Files With VIM

Filed under: bash, cli, howto, Linux, tutorial, vi — ioconnor @ 6:40 pm

One of the main problems with VI, VIM and GVIM is the navigation between multiple files. The “:n” and “:rew” commands may get somebody through the basics. But seriously it’s not enough. The secret is writing little macros for the work being done. Often this is such a daunting task that most people haven’t got a clue. So hence this article. The idea presented here is to show how to make a navigation file so that once the cursor is over the file name in question, or information needed to identify the file, two keystrokes will take you to that file.

First there is the ~/.vimrc file or equivalent depending on the OS. Locate it. Add to this file the macros.

:map ** “zyy:@z<Enter>

This command maps the keystrokes “**”, the two asterisks hit in rapid succession, to the commands that follow it. The command that follows reads the line the cursor is on into the z buffer and then executes that buffer. This is very useful because now the commands you want to test can be written on a line and then executed by pressing “**”. It opens the world of macros to you.

So lets write a macro that will bounce the window between the current file and the last file you edited. Say you started gvim by typing gvim file1 file2 file3 and once in file1 you then typed :n and :n again. So you are now in file2. The goal of this macro is to let you move to file2 without doing a “:rew” and “:n”. So start a new line in file 3 and type in:

:map *; :e#<Enter>

Then press “**” over the line so this macro becomes available. Now if you press “*;” you’ll go to file2.

Now we are ready to write some macros to view log like files. I’ll start with the one I wrote yesterday. Websites require a file named “Sitemap.xml” which describes each file’s location, importance, and frequency they should be crawled by the search spiders. Each line has a format similar to this:

<url><loc>http://www.domain-name.com/index.html</loc><priority>0.50</priority><changefreq>weekly</changefreq></url&gt;

Three macros might be all that is needed to navigate a website via its Sitemap.xml. File navigation this way ensures the Sitemap.xml always stays relevant. So the first macro might be something like:

:map *S :e ~/path/Sitemap.xml<Enter>

This is simple enough to understand. When “*S” is typed it will take you to the Sitemap.xml file.

Now the following is all that is needed to edit the files listed in the Sitemap.xml by putting the cursor on the line containing the file and typing “*e”:

:map *e :w<Enter>$0fhf<mz0fml”ay`zo:e ~/path-to-website/<Esc>”ap<Esc>”zyyu:@z<Enter>

First the file is written out with this command “:w<Enter>”. Depending on your habits you may want to remove that.
Then the cursor is moved to the end of the line and then to the beginning with “$0”. There is history to this that is wasted on VIM/GVIM.
Then a search for the ‘h’ in “http” is done, to get to the start of the URL, with “fh” and then another search for the end of the URL with “f<”
Then that location is marked as location “z” with the command “mz”. Then we go back to the start of the file name which for my Sitemaps can be done for searching for the “m” in com. You may have to vary the search depending on your domain name. Then moving the cursor over to the “/”. So altogether it’s “0fml”.
Now yank the name of the file into the a buffer using the backwards tick “”ay`z”.
Now create a line with the command needed to edit the file just yanked “o:e ~/path-to-website/<Esc>”ap<Esc>”
Finally yank the newly created line into the z buffer, undo the line just created, and then execute the z buffer so the editor is now editing the file “”zyyu:@z<Enter>”

The next command sets the browser to the file in question:

:map *b :w<Enter>$0fhf<mz0fh”ay`zo:!gnome-open <Esc>”ap<Esc>”zyyu:@z<Enter>

These techniques can be used for almost anything to avoid typing names. In fact a list of all files you edit, in a centralized place, is all that’s needed to prevent ever repeatedly typing out a file name again. Once familiar with these techniques most of the files needing editing can be gotten to with two key strokes. This gives VI, VIM, and GVIM the ability to navigate files more easily than an IDE without losing all the power you surrender when using an IDE. And it’s all free!

January 20, 2010

Restarting The Synergy Client

Filed under: Uncategorized — ioconnor @ 5:33 pm

Because of Ubuntu’s buggy screen configurations across reboots synergy must often be restarted once the screens and resolutions are set properly. Here’s my script to do that:

#!/bin/bash
kill $(ps -ef | grep synerg | grep -v grep | tr -s ' ' | cut -d ' ' -f2); /usr/bin/synergyc --daemon --restart ###.###.###.###

It will kill any and all synergy clients and then restart the synergy client hopefully picking up the correct screens and dimensions. I call it RSSC for ReStart Synergy Client.

Cron On Ubuntu

Filed under: Uncategorized — ioconnor @ 5:05 pm

Cron on Ubuntu is busted. (Unless you take the time to learn all the little differences, err upgrades, between it and all other crons since time began.) The best way to work with it is through a busted gnome utility. (Busted in the sense it quits working when you upgrade your system every 6 months.) Then there is the fact you can never remember the name of this utility when you need it. Hence this post.

From https://help.ubuntu.com/community/CronHowto

The following directions tell you how to set up scheduled tasks the traditional way using the command line, but it is much easier to use the Gnome <em>Scheduled tasks</em> tool (from the <em>gnome-schedule</em> package) in <em>Applications</em> –&gt; <em>System Tools</em>.

Furthermore the best, (only), way to properly install it is to avoid synaptic and use the menu “Application->Ubuntu Software Center” so that a new category called “System Tools” gets set up under Applications in your menu.

Don’t you hate Ubuntu?

Xmarks (Foxmarks) For Chrome

Filed under: Uncategorized — ioconnor @ 4:57 pm

Xmarks has come out with an extension for Chrome so all bookmarks can be shared across chrome, ie, firefox, and safari regardless of the computer being used. However it doesn’t work very well on chrome yet.

https://chrome.google.com/extensions/detail/ajpgkpeckebdhofmmjfgcjjiiejpodla

January 18, 2010

Spelling It Out

Filed under: Uncategorized — ioconnor @ 6:55 pm

It was obvious on 9/11 and it is still obvious.

Social Networks Suck

Filed under: Uncategorized — ioconnor @ 5:47 pm

Social networks are the latest rage. Maybe the 2010s will be known as the Social Network Decade. Anybody who does not want to join gets bombarded with articles like from this idiot:

Debunking The Silly Complaints From People Who Don’t Like Social Networks

This author does address stupid complaints. Not the real ones. What are the real ones? I know I don’t like social networks but why don’t I like them? Am I just antisocial or is there something more to it? Perhaps it is because I do think most people are idiots. That I do think they are religious. People are way too fat. That they have very little integrity as demonstrated by all of our politicians and business leaders. That Americans care about trivial creature comforts rather than important matters. Yes I do have a very low opinion of my fellow Americans. Why would I want to surround myself with bubble heads on a social network?

Social networks help enforce mediocrity. Help people become and stay part of the Matrix. Instead people should learn how to pick up the phone and or visit others whom they actually respect instead of networking with every person they’ve ever come across in their life in places like Facebook.

Intel Black Hat Policies

Filed under: Uncategorized — ioconnor @ 2:24 pm

even benchmarking programs are affected by this, up to a point where benchmark results can differ greatly depending on how a processor identifies itself. Ars found out that by changing the CPUID of a VIA Nano processor to AuthenticAMD you could increase performance in PCMark 2005’s memory subsystem test by 10% – changing it to GenuineIntel yields a 47.4% performance improvement! There’s more on that here [print version – the regular one won’t load for me].

This is from “Intel Forced to Remove “Cripple AMD” Function from Compiler?

Wouldn’t it be great if Intel were forced to pay these companies back?

Getting Rid Of Facebook and all the others?

Filed under: Uncategorized — ioconnor @ 2:06 pm

See “Why Does Facebook Want to Suck the Fun Out of Unfriending?” for details on how to do it with flair.

Older Posts »

Blog at WordPress.com.