lxtips

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

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]

restrict keyword search to bookmarks in #firefox by adding a '*' to the search string http://j.mp/11hpfC

From MozillaZine Knowledge Base

(Redirected from Browser.urlbar.match.url)

When you type a keyword into the Location Bar, Firefox does text string searching within your history and bookmarks. Results are displayed in a drop down list. The drop-down list results show you the page’s favicon, the full title, the URL, and whether you have bookmarked or tagged the page in a richly formatted two-line display.

You can restrict what kind of results are shown in the drop down list by using customizable characters. Include the character anywhere in the address bar separated by spaces to have it restrict what results are displayed. The characters are as follows:

Preference names in about:config default key action
browser.urlbar.match.title # Returns results that match the text in the title.
browser.urlbar.match.url @ Returns results that match the text in the URL.
browser.urlbar.restrict.bookmark * Returns only results that are from the bookmarks.
browser.urlbar.restrict.history ^ Returns only results that are from the browser’s history.
browser.urlbar.restrict.tag + Returns only results that have been tagged.
browser.urlbar.restrict.typed ~ Returns only results that have been typed.

If you do not select a result from the drop-down list but just press enter, Firefox takes you to the top Google result for that search by default.

However, by modifying the preference called keyword.URL, you can change this behavior. Here are a few example values:

http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=

Google's "I'm Feeling Lucky" (default pre-Firefox 2.0)

http://www.google.com/search?ie=UTF-8&sourceid=navclient&gfns=1&q=

Google "Browse by Name" (Automatically takes you to sites with a clear match, else performs a Google search) (default in Firefox 2)

http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=

Google Search (Google search results page)

If the keyword.URL search is disabled, Firefox may still attempt a simpler lookup, by concatenating a prefix and suffix on the supplied domain name. This action may be enabled or disabled using the browser.fixup.alternate.enabled setting in about:config. The prefix and suffix used can be set using browser.fixup.alternate.prefix and ...suffix.

For more advanced search capabilities, you may want to look into using keyword searches and the Search Bar.

See also

External links

Loading mentions Retweet

Comments [0]