lxtips

random hints for linux, bash, vim, firefox, ubuntu, gnome, nautilus, vlc... 

to alter location bar behaviou in #firefox, navigate to /usr/lib/firefox-addons/searchplugins and edit google.xml

Re: About Firefox's Google search engine

Postby mr kenmore on Fri Feb 06, 2009 2:11 am

Yeah, I was completely annoyed by the lack of options in the linux mint google. My replace was very easy. I have a few installs of Ubuntu/Kubuntu. All you need to do is copy the google.xml in the regular version and replace the file in the linux mint version. Took two seconds. Restart firefox and you're done.

/usr/lib/firefox-addons/searchplugins

Loading mentions Retweet

Comments [0]

find your mac address in #linux with ifconfig -a http://j.mp/4BIx87

How to find/display your MAC Address:
Unix/Linux

Linux

  • As the root user (or user with appropriate permissions)
  • Type "ifconfig -a"
  • From the displayed information, find eth0 (this is the default first Ethernet adapter)
  • Locate the number next to the HWaddr. This is your MAC address
The MAC Address will be displayed in the form of 00:08:C7:1B:8C:02.
Example "ifconfig -a" output:
eth0      Link encap:Ethernet HWaddr 00:08:C7:1B:8C:02
          inet addr:192.168.111.20  Bcast:192.168.111.255  Mask:255.255.255.0

...additional output removed...

Loading mentions Retweet

Comments [0]

go to line 785 in #vim with :785 http://j.mp/r6OK1

Check out this website I found at arioch.unomaha.edu

Loading mentions Retweet

Comments [0]

install day of ubuntu slideshow wallpaper in #ubuntu with sudo apt-get install day-of-ubuntu-wallpaper http://j.mp/10c9y6

Loading mentions Retweet

Comments [0]

edit autorefresh in mint #linux mintupdate with Edit>Prefs>Autorefresh http://j.mp/1hW9o8

Loading mentions Retweet

Comments [0]

add .tabs-newtab-button {display: none;} to userChrome.css to hide new tab button in #firefox http://j.mp/i05zJ

Loading mentions Retweet

Comments [0]

thanks @IT_Kills . hit Space then s in #tweetdeck to retweet an update

How do I navigate in TweetDeck using the keyboard?

Submitted Oct 13 by richard

You can easily navigate TweetDeck using just your keyboard.

The following hot-keys are activated while the "compose an update" window is not open.

   Key Action

  ↑ or k

Navigate up the current column

  ↓ or j

Navigate down the current column

  ← or h

Navigate to the left

  → or l

Navigate to the right

     c

Open the update window

 SPACE 

Activate the Heads-Up-Display (HUD) (see below)

   Esc

Close the current menu/popup

    F1

Open the TweetDeck Support site

       .

Open the "profile picture" menu

       /

Create a new Twitter search column

 

With the update window open, the following hot-keys are available

  Key   Action
    Esc   Close the update window
   F1    Open the TweetDeck Support site

 

The Heads-Up Display (HUD)

Pressing SPACE on any update in TweetDeck will activate the HUD - a simple menu that gives you access to the most common actions based for the type of update you currently have selected.

HUD_-_Tweet.png

You can access the functions displayed in the HUD in 3 ways:

  • Press the hotkey underneath the icon representing the function (e.g. in the above image, S would be Re-tweet)
  • Navigate across the HUD using the arrow keys, then press ENTER to select the function
  • Click the HUD icon using the mouse

The following functions are available from the HUD per column type

Column Type(s)

   Action

  Hot-Key

All Friends, Groups, Mentions
Search, Favourites

   Reply

   Re-Tweet

   DM

   Favourite

  A

  S

  D

  F

New Followers  

   Follow

   Block

  A

  S

TweetDeck Recommends

   Follow

  A

Facebook

   Comment

   Like

   Write on Wall

  A

 

  D

a to reply . s to re-tweet . d to direct message . f to fav....

Loading mentions Retweet

Comments [0]

save page as in #firefox with ctrl+s http://j.mp/3d76wP

Loading mentions Retweet

Comments [0]

edit ~/.font.conf to smarten up font rendering in #firefox http://j.mp/VFFWD #linux

Loading mentions Retweet

Comments [0]

remove the first 6 chars from a line with #sed 's/^.\{6\}//' http://j.mp/11abZy

SotD – Remove the First N Characters From a Line

I was asked today to remove the first 6 characters from every line in a document. It was known that each line contained at least 6 characters. For me, that means a find a replace. Here is how I did it (in a number of different ways). Can you think of any other ways to do it?

cut -c7-
rr ^.{6}
colrm 1 6
rr s/^.{6}//
sed 's/^.\{6\}//'
perl -pe 's/^.{6}//'
ruby -pe 'sub /^.{6}/,""'
gawk 'BEGIN{FIELDWIDTHS="6 999"}{print$2}'

I was pretty happy with rr taking the prize for least characters. I do want to point out that since rr defaults to multi-line and global replacements the “^” is required. If you wanted to remove the “^” (like you could with sed, perl, and ruby) then you would have to use the “–line” or “-l” and “–notglobal” or “-ng” options. So a single character replaces 7! If you want to grab rr just do:

$ sudo gem install regex_replace

Also, here is a link to gawk – GNU’s awk. This has the very nice FIELDWIDTHS variable, which is extremely useful!

Also keep in mind that the regular expressions above ^.{6} only work because the lines were known to have at least 6 characters. If we didn’t know that we would have had to use something like ^.{0,6} to allow up to 6 characters (and even that could be ^.{1.6} ignoring blank lines which can’t change). So again the requirements for this challenge were important.

Update!

I came across a neat little unix utility I didn’t know about called “cut”. As you can see, the new command tops the list quite handily too. “cut -c 7-” is actually cutting from each line the 7th character onwards (counting starts from 1). In this case once it spits what it cuts out to stdout; so it leaves behind those first 6 characters and therefore accomplishes our goal. In the above list I removed the optional space after “-c” to make it just a tad shorter. Pretty neat.

Then I found “colrm” which is the most straightforward. This one wins in simplicity. No hacks, just straightforward does exactly what you think it does. Very cool.

Double Update!

I figured since quite a bit of my rr usage has an empty string for the second argument, I figured it would be okay to throw that in as the default case. So now there is a third usage for rr, which is great for pipes, that just strips something out. That brings rr back up to a tie for first place. Very cool.

Loading mentions Retweet

Comments [0]