PDA

View Full Version : Linux SemiHidden Tips



Islington
March 17th, 2009, 03:07 AM
So there are a lot of things that experienced users, like yourself know about that make life much easier for users. Perhaps you are a new user, who has discovered something. Please Contribute to this thread and make those little things known! :)

Here are the ones that I know and use:



Selecting any text automatically adds it to a clipboard. MiddleClicking in a text field/place will paste this text.



Window List Applet, on a panel: you can cycle through the windows by using the scrollwheel.



Scrollbar in gnome: right clicking on the up/down arrows will scroll you all the way up/down.



Compiz scale: when scale is activated, you can filter through the windows by typing (a bit like gnome do), by default this is case-sensitive, but can be turned off using the option in the Scale Window Title Plugin

smartboyathome
March 17th, 2009, 03:10 AM
Here is my tip (related to your first one):


In Linux, there are actually two clipboards. One uses the standard ctrl-c, ctrl-v meathod of copying and pasting, and the other uses the highlight, middle click paste meathod.

Another:


Read the bolded link in my signature to avoid the mistake mentioned.

Islington
March 17th, 2009, 03:21 AM
snipYour second tip is rather important, I feel. :D

bsharp
March 17th, 2009, 03:47 AM
I know someone else will eventually post this, but I will do it first :twisted:

Tab-complete.

Type the first couple of letters of a program/command into a terminal and push tab twice. it will either finish out the rest of the program's name or give a list of several programs with the same beginning. (If someone can explain it better, please do so.)

Islington
March 17th, 2009, 03:52 AM
I know someone else will eventually post this, but I will do it first :twisted:

Tab-complete.

Type the first couple of letters of a program/command into a terminal and push tab twice. it will either finish out the rest of the program's name or give a list of several programs with the same beginning. (If someone can explain it better, please do so.)

this only seems to work for me when specifying a directory path ...:|

smartboyathome
March 17th, 2009, 04:01 AM
this only seems to work for me when specifying a directory path ...:|

You need to switch to something like ZSH to enable it on more stuff than commands and directory paths. It doesn't work with sudo.

spupy
March 17th, 2009, 02:20 PM
Scrollbar in gnome: right clicking on the up/down arrows will scroll you all the way up/down.
Whoa, thanks for that one :)

My protips:

Something that in Windows is not working everywhere: ctrl+backspace and control+delete delete whole words, not only a single letter. Similarly, control+arrows moves the caret (text cursor) to the next/previous word.


Firefox: Press ctrl+shift+T to restore the last closed tab. It will also restore any text you've written in that tab, any buttons you've clicked, and its whole back/forward history.

jimi_hendrix
March 17th, 2009, 02:28 PM
alt+sysrq+REISUB....saves lives

Mehall
March 17th, 2009, 02:29 PM
Generally, if you use scrollwheel, you scroll on whatever window the cursor is over, not necessarily the active window


And not tested it in Gnome, but in Openbox if you scroll down on an icon in a task bar (so it might be specific to that task bar in Crunchbang) then it will minimize to tray the window you scrolled of the icon.

Thats abad explanation. I scroll down on Firefox's icon, Firefox minimizes. I scroll up, it un-minimizes.

spupy
March 17th, 2009, 02:31 PM
Generally, if you use scrollwheel, you scroll on whatever window the cursor is over, not necessarily the active window.

It is a good tip. It works on all window managers, i think. It's a xserver thing.

Mehall
March 17th, 2009, 02:34 PM
I knew that one worked in them all, does the other one?

Bodsda
March 17th, 2009, 02:37 PM
Your friends


Man pages (man sudo)
Google (This is the greatest undisputed resource you have)
--help (If you need to know about a programs command line options use <command> --help e.g. mv --help)


Command line tool for downloading youtube videos


sudo apt-get install youtube-dl

consult
man youtube-dl to learn how to use it

bryncoles
March 17th, 2009, 02:38 PM
this only seems to work for me when specifying a directory path ...:|

try pressing tab twice fast...

ssam
March 17th, 2009, 02:45 PM
You need to switch to something like ZSH to enable it on more stuff than commands and directory paths. It doesn't work with sudo.

you dont need zsh. you just need the bash-completion package.

if this does not enable advanced completion, then you may have it disabled in you .bashrc. old versions of ubuntu had it disabled by default, maybe you kept your .bashrc since then.

it will autocomplete program names, but it will do it by executable name, rather than pretty name. so gedit rather than Text editor

sisco311
March 17th, 2009, 03:12 PM
It doesn't work with sudo.

It works in Ubuntu by default.

In arch you have to install bash-completion and add something like:

if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

complete -cf sudo
complete -cf gksu
complete -cf gksudo

to the ~/.bashrc file.

EDIT:
@ssam
i did't refresh the page before posting. :)

smartboyathome
March 17th, 2009, 03:54 PM
Ah, ok. I'm just not used to bash anymore. :|

Trail
March 17th, 2009, 04:02 PM
Edit: Eh yeah, nevermind.

damis648
March 17th, 2009, 04:08 PM
alt+sysrq+REISUB....saves lives

Wrong!!
Its RSEIUB. :popcorn:
Raising Skinny Elephants Is Utterly Borning.

Islington
March 18th, 2009, 12:33 AM
Wrong!!
Its RSEIUB. :popcorn:
Raising Skinny Elephants Is Utterly Borning.

:popcorn: Neither works for me, because the sysRq key doesn't seem to trigger anything.

Exershio
March 18th, 2009, 12:54 AM
Pressing CTRL + C in terminal will terminate any current process running. For example, if you're doing a disk check in terminal, CTRL + C will terminate it.

phaed
March 18th, 2009, 01:00 AM
This is probably the most useful thread on Ubuntu Forums that I've read that had nothing to do with a specific problem I was having.

"Selecting any text automatically adds it to a clipboard. MiddleClicking in a text field/place will paste this text."

You just made my life a lot easier. :)

yabbadabbadont
March 18th, 2009, 01:01 AM
Wrong!!
Its RSEIUB. :popcorn:
Raising Skinny Elephants Is Utterly Borning.

According to the wikipedia entry, both are correct, but there is debate about whether to sync early or late in the sequence. The one originally posted is the one listed at wikipedia.

Personally, I sync in both places, just to be safe.

I.E. Raising Skinny Elephants Is So Utterly Boring

;)

vambo
March 18th, 2009, 01:07 AM
This is probably the most useful thread on Ubuntu Forums that I've read that had nothing to do with a specific problem I was having.

"Selecting any text automatically adds it to a clipboard. MiddleClicking in a text field/place will paste this text."

You just made my life a lot easier. :)

As an adendum
<Shift> <Insert> will also do the pasting

Islington
March 18th, 2009, 01:21 AM
Pressing CTRL + C in terminal will terminate any current process running. For example, if you're doing a disk check in terminal, CTRL + C will terminate it.

excellent! Is there anyway to move it to the background? so that it no longer has to use the terminal?

init1
March 18th, 2009, 01:35 AM
lsof

lists all open files.

sisco311
March 18th, 2009, 01:40 AM
excellent! Is there anyway to move it to the background? so that it no longer has to use the terminal?

yes, press Ctrl+Z to stop the process, then

you can use the bg command to continue it in the background and

fg to continue it in the foreground.

you can list the jobs with the jobs -l command.

for more info read the man page.

man bash
press / to search the page, type bg(or any other search term) and hit Enter.

for the next match just hit / and Enter. press q to quit.

MaxIBoy
March 18th, 2009, 01:57 AM
So there are a lot of things that experienced users, like yourself know about that make life much easier for users. Perhaps you are a new user, who has discovered something. Please Contribute to this thread and make those little things known! :)

Here are the ones that I know and use:
None of these have anything to do with Linux. They are all based around either GNOME or Compiz, both of which run on operating systems other than Linux. (Although a lot of these actions are conventional behaviors that appear in other desktop environments/window managers, in a similar way to how F11 often means "fullscreen.")

Likewise, tab completion is one of the features of BASH, the standard command line interpreter (CLI) for UNIX. BASH runs on an enormous number of operating systems, including Windows (Cygwin.) However, tab completion is also an expected feature, going back to 1964 with the Berkley Timesharing System (it's true, I just looked it up.) It's a feature of almost every CLI in existence, including DOS.




Also, here are some of my tips.

#built into BASH, may or may not work on other CLIs
history #built-in program that prints out your recent command history; more useful when piped through to grep
cd #defaults to "cd ~"
cd - #takes you to the previous directory

#networking stuff. These are programs that will run if you have them installed, doesn't matter what CLI you use to call them. Almost all Linux distros include these by default.
ifup eth0 #automatically configure ethernet connection; short for "ifconfig eth0 up"
ifdown eth0 #short for "ifconfig eth0 down"
iwconfig wlan0 essid any #for a wireless card named wlan0, automatically join the network with the strongest signal
iwconfig wlan0 essid Max_network #try to join a wifi network with the name "Max_network"
iwlist wlan0 scan #scan for networks and display stats about the results

Sealbhach
March 18th, 2009, 03:09 AM
Stick a bunch of terminal commands into a text file, preceded by #!/bin/bash

Save the file. Make it executable, by right-clicking on it and going to the permissions tab. Double click on the file, select Run in Terminal.

Example here:


#!/bin/bash
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get clean all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get clean all
sudo apt-get autoremove

This keeps the package manager clean and oiled. But you can have any set of commands.


.

MaxIBoy
March 18th, 2009, 03:34 AM
Stick a bunch of terminal commands into a text file, preceded by #!/bin/bash

Save the file. Make it executable, by right-clicking on it and going to the permissions tab. Double click on the file, select Run in Terminal.

Example here:


#!/bin/bash
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get clean all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get clean all
sudo apt-get autoremoveThis keeps the package manager clean and oiled. But you can have any set of commands.


.EEK! Be careful where you aim those dist-upgrades!

smartboyathome
March 18th, 2009, 04:01 AM
:popcorn: Neither works for me, because the sysRq key doesn't seem to trigger anything.

If you're on a laptop, then you should do this:

Hold Alt, then hold fn down and perss your sysrq key and then let go of the fn key, then use your boring elephants to kill your computer. ;)

treesurf
March 18th, 2009, 06:22 AM
If you're on a laptop, then you should do this:

Hold Alt, then hold fn down and perss your sysrq key and then let go of the fn key, then use your boring elephants to kill your computer. ;)


That gave me a screenshot of a screenshot.:popcorn:

sujoy
March 18th, 2009, 06:42 AM
to end anything in a terminal that expects input, press Ctrl+D
for example the terminal itself, expects commands, so to close it you can use Ctrl+D instead of typing 'exit' everytime

run a command from terminal and stick it to background.
$ gedit &
that in bash will run gedit and free up the terminal for further use.
in zsh try this instead,
$ gedit &!

for the above, you might sometimes see harmless error/warning messages, like for instance something in your gtkrc is wrong. so redirect the error to /dev/null like this
$ gedit 2>/dev/null & _________ (for bash)
$ gedit 2>/dev/null &! __________ (for zsh)

another pro-tip, run important commands that must not be interrupted like distupgrades, filesystem check, whatever, inside screen. then detach it. that way if your X crashes it wont matter. i am saying this because xserver is the most probable thing to crash on a linux system.

use apropos to find commands related to a search keyword.
$ apropos sud
that should find gksudo, sudo, visudo etc

in firefox, press Alt+D or Ctrl+L to highlight the address bar. and you can assign a keyword to your bookmarks from the bookmark property.
so i have this community cafe bookmarked with a keyword of 'ufc'. hence i type 'ufc' in the address bar and arrive here :)

Trail
March 18th, 2009, 08:29 AM
How about

nohup <command>
to execute something in the background, and keep it running even when the terminal is closed. Can be a lifesaver.

yabbadabbadont
March 18th, 2009, 08:36 AM
How about

nohup <command>
to execute something in the background, and keep it running even when the terminal is closed. Can be a lifesaver.

That brings back (painful) memories of my Unix days and fighting with crappy Telebit modems while doing support. You had to nohup any command that might take more than a few seconds to run because you never knew when the connection was going to drop on you. You also had to be careful to always use the absolute path to things when removing them as the modems had this bad habit of resending the commands at random times if you had a bad connection. (and they would be run in whichever directory was your current one...)

Occasionally Correct
March 18th, 2009, 08:47 AM
Bash tip: Use ! to recall history. For example, !mv recalls and repeats the last line entered that starts with mv (it executes the entire line, so if you entered something like mv x y; touch x, it repeats both commands). Use a number after the ! to recall a certain line in history---useful alongside MaxIBoy's tip about the history command! :)

mcduck
March 18th, 2009, 10:54 AM
Wrong!!
Its RSEIUB. :popcorn:
Raising Skinny Elephants Is Utterly Borning.

I'd say REISUB. You'll want to end your processes (E and I) before you sync your drives (S). Syncing them before ending running programs would be quite pointless.

Sealbhach
March 18th, 2009, 11:26 AM
EEK! Be careful where you aim those dist-upgrades!

OK, but I'm using this in Jaunty so what the heck, I might get a sneak preview of Karmic Koala.:P


.

Islington
March 18th, 2009, 12:20 PM
Is there a difference between using
<command> &(this seems to be a faster way of doing (ctrl+z + bg) and doing
nohup <command>.


I gotta say I love ff bookmarks, I also have some bookmarklets, as the bookmarks do accept javascript.

Botbob89
March 18th, 2009, 12:22 PM
Not really a tip for running Ubuntu; but when you first start using it, be patient and know that you are going to make mistakes.

Installing it and expecting to be someone who can fully use it with no problems is just wrong :P

Also, and slightly related, Ubuntu is not Windows............

Trail
March 18th, 2009, 12:48 PM
Is there a difference between using
<command> &and doing
nohup <command>.

In the first way, if you close the terminal window (or SSH connection etc), the command stops executed. In the second way, the command still runs whatever happens.


Bash tip: Use ! to recall history. For example, !mv recalls and repeats the last line entered that starts with mv (it executes the entire line, so if you entered something like mv x y; touch x, it repeats both commands). Use a number after the ! to recall a certain line in history---useful alongside MaxIBoy's tip about the history command!

Also try using Ctrl+R. This is a reverse search in history, keyed to some text you type after pressing Ctrl-R. For example if i pressed Ctrl-R and "ouch", it would probably find the line "mv x y; touch x" you mentioned above. Hit Ctrl-R another time, and it retrieves the previous result. Play with it a bit, it's very handy.

Sealbhach
March 18th, 2009, 12:58 PM
I saw someone give another way to open up an app in the terminal which will not close when the terminal is closed:


command &disown


.

3rdalbum
March 18th, 2009, 01:59 PM
Pressing Alt-F2 in Gnome, KDE or XFCE will open a "Run application" box where you can quickly type the name of the program or command you want to run, and then press Enter to run it. Much quicker than surfing the Applications menu... "is it in Graphics or is it in Office? Or in Accessories?"

--------
Placing a little penguin ornament on top of your computer will prevent most kernel panics, and cause your computer to run faster.
--------

If you want to schedule your computer to shut down, use the "at" command:


sudo at now + 7 hours
halt


(then press Control-D to quit the At prompt)

Just don't shut down your computer manually, otherwise the next time you start it up it will run the AT job... and shut down your computer again.

--------

If you're on a laptop or netbook, download Powertop from the repositories to see what programs are wasting power by causing your CPU to keep waking up. It also suggests things you can improve in your system to get better battery life.

Bodsda
March 18th, 2009, 02:47 PM
To shutdown


sudo shutdown -P now

To reboot


sudo shutdown -r now

To shutdown in 1 hour


shutdown -P now + 60

To shutdown your sons computer at 23:00 to make him go to bed


sudo shutdown -P 23:00

=================
How to stop your partner from using your computer to access facebook/<insert name of annoying website here>

We need to edit the /etc/hosts file (you need sudo for this) (replace 'vim' with your preffered text editor

sudo vim /etc/hosts
The file should look something like this

127.0.0.1 localhost
127.0.1.1 bod-ubuntu
92.2.76.121 www.bodsda.co.uk

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

As you can see i have already put in an entry, which redirects 'www.bodsda.co.uk' to '92.2.76.121' because i couldnt be bothered to purchase a domain name.

Anyway what we need to do is add a newline to the top section (before the #comment)

add a line like the following


91.189.94.12 www.facebook.com

The syntax is
<address of redirect> <www.url-of-site-to-redirect.com>

The line in my example will cause anyone who attempts to go to www.facebook.com on your computer to end up at www.canonical.com

Have fun,

Bodsda

unutbu
March 18th, 2009, 02:58 PM
How to wake your computer up (by itself) after 30 minutes:


sudo sh -c "echo $(date '+%s' -d '+ 30 minutes') > /sys/class/rtc/rtc0/wakealarm"
sudo shutdown -P now

See http://ubuntuforums.org/showpost.php?p=6896157&postcount=5
for how to wake your machine up at 5am every day.
Add
cvlc reveille.ogg to /etc/rc.local and you have an alarm clock :)

wersdaluv
March 18th, 2009, 03:00 PM
Your friends


Man pages (man sudo)
Google (This is the greatest undisputed resource you have)
--help (If you need to know about a programs command line options use <command> --help e.g. mv --help)


Command line tool for downloading youtube videos


sudo apt-get install youtube-dl

consult
man youtube-dl to learn how to use it
That's so un-pro. hehe. Just access the flash vids in /tmp/ hehe

Islington
March 18th, 2009, 07:04 PM
How to wake your computer up (by itself) after 30 minutes:


sudo sh -c "echo $(date '+%s' -d '+ 30 minutes') > /sys/class/rtc/rtc0/wakealarm"
sudo shutdown -P now

See http://ubuntuforums.org/showpost.php?p=6896157&postcount=5
for how to wake your machine up at 5am every day.
Add
cvlc reveille.ogg to /etc/rc.local and you have an alarm clock :)

This is brilliant! Absolutely brilliant, now I can take a nap and tell my comp to wake me up.


wersdaluv: some flash vids dont show up in /tmp for some reason. Most obvious example hulu.

Islington
March 18th, 2009, 07:08 PM
--------
Placing a little penguin ornament on top of your computer will prevent most kernel panics, and cause your computer to run faster.
--------


Or a tasmanian devil is reported to work just as well (Source. (http://www.phoronix.com/scan.php?page=news_item&px=NzE1MA))

lykwydchykyn
March 18th, 2009, 07:26 PM
- SSH is the swiss army knife of networking on Linux. It covers a wide variety of functions -- remote terminal, remote desktop, file sharing, file synchronization, encrypting other services. If you learn one CLI program, learn SSH.

- If you use a full blown desktop environment like GNOME, KDE, or XFCE, also install a minimal window manager like jwm, openbox, or icewm. That way, if something gets screwed up in your main environment (bad compiz setting, stuck lock file, etc) you still have a graphical environment to log into so you don't have to fix it all in a VT.

Islington
March 19th, 2009, 12:11 AM
bump!

DougieFresh4U
March 19th, 2009, 12:41 AM
I saw someone give another way to open up an app in the terminal which will not close when the terminal is closed:


command &disown


.

I know the command name 'nohup' , but I have forgotten if it's before or after what ever it is you want to stay open from terminal.
Some one care to help out on this one please?

yabbadabbadont
March 19th, 2009, 12:44 AM
I know the command name 'nohup' , but I have forgotten if it's before or after what ever it is you want to stay open from terminal.
Some one care to help out on this one please?

Go back one page... :lol:

Edit: OK, two pages since this one is on a new one. :D

DougieFresh4U
March 19th, 2009, 12:56 AM
Go back one page... :lol:

Edit: OK, two pages since this one is on a new one. :D

That's twice today I have gotten myself into something without reading the whole thread :(
Thanks

red_Marvin
March 19th, 2009, 12:58 AM
As an adendum
<Shift> <Insert> will also do the pasting

Also, ctrl+insert copies to clipboard and shift-delete cuts, this dates back to the dos days (msdos edit and qbasic accepts it). However, note that in nautilus shift-delete is "delete file permanently" (ie like rm)

I'd also recommend learning a cli web browser; links, link2, lynx, w3m - great to search for help with if X breaks down, to that list I should probably add irssi or somesuch.

Oh, and learn ed... it is the standard text editor.

chris4585
March 19th, 2009, 01:44 AM
Here are some things I've learned by just messing around with, ctrl, alt, shift, scrolling, and middle mouse click mostly, which has taught me that these combinations are everywhere.

Hold down middle mouse button on a file and drag it somewhere to link/copy/move it somewhere else.

Holding ctrl and the middle mouse button with a file/folder on the desktop with compiz cube/sphere/etc.. will do the same as holding the middle mouse button in nautilus, helpful if you want to link/copy/move a file from the desktop to a folder.

In firefox you can drag/drop links to FILES to automatically download to a location in nautilus including the desktop. This also works with image links to files, aka a image link to a video will work too.

ctrl + scroll in firefox will increase/decrease the size of the page

ctrl + h in nautilus will unhide files, and ctrl + h again will hide them again

To create a hidden file just add a period infront of the file name, such as .file-name-example.txt

In gnome-terminal ctrl+shift+v will paste whatever is in your clipboard.

In firefox middle clicking on a link will open the link in a new tab, same goes for nautilus with a folder.

alt + left click on a window will move a window

In nautilus with list view, hold down ctrl and select a file, and select another file while holding down ctrl, and another and you can move those certain files only or you can link/copy/move those certain files drag and droping with the middle mouse button, or just regular drag and drop will work too.

You can select in bulk with nautilus in list view with selecting one file to initiate the starting point, and holding down shift to a file way down the list, you will then have a bunch of selected files

(I just now discovered this works in other views, but to me seems most useful in list view).

With compiz enabled and with the cube/sphere/etc.. using the middle mouse button will initiate the cube/sphere/etc..

Holding down ctrl + scrolling in nautilus and other apps usually makes items bigger.

MaxIBoy
March 19th, 2009, 03:46 AM
Here are some things I've learned by just messing around with, ctrl, alt, shift, scrolling, and middle mouse click mostly, which has taught me that these combinations are everywhere.

Hold down middle mouse button on a file and drag it somewhere to link/copy/move it somewhere else.

Holding ctrl and the middle mouse button with a file/folder on the desktop with compiz cube/sphere/etc.. will do the same as holding the middle mouse button in nautilus, helpful if you want to link/copy/move a file from the desktop to a folder.

In firefox you can drag/drop links to FILES to automatically download to a location in nautilus including the desktop. This also works with image links to files, aka a image link to a video will work too.

ctrl + scroll in firefox will increase/decrease the size of the page

ctrl + h in nautilus will unhide files, and ctrl + h again will hide them again

To create a hidden file just add a period infront of the file name, such as .file-name-example.txt

In gnome-terminal ctrl+shift+v will paste whatever is in your clipboard.

In firefox middle clicking on a link will open the link in a new tab, same goes for nautilus with a folder.

alt + left click on a window will move a window

In nautilus with list view, hold down ctrl and select a file, and select another file while holding down ctrl, and another and you can move those certain files only or you can link/copy/move those certain files drag and droping with the middle mouse button, or just regular drag and drop will work too.

You can select in bulk with nautilus in list view with selecting one file to initiate the starting point, and holding down shift to a file way down the list, you will then have a bunch of selected files

(I just now discovered this works in other views, but to me seems most useful in list view).

With compiz enabled and with the cube/sphere/etc.. using the middle mouse button will initiate the cube/sphere/etc..

Holding down ctrl + scrolling in nautilus and other apps usually makes items bigger.
About half of those work on almost all programs. But I must admit I did not know you could middle click-n-drag.

DOS4dinner
March 19th, 2009, 05:01 AM
Did anyone mention xkill? I love brutally killing programs;)

Simply hit alt-f2, then type xkill and hit enter. Your mouse becomes an x, and the next program you click on will be killed instantly.

Also, this terminal commmand:

xrandr -s 0

It resets your monitor's resolution back to what it should be. Useful for wine apps that crash, but leave your desktop all huge and 640x480.

FuturePilot
March 19th, 2009, 09:02 AM
Ever forget to use sudo in front of some command that needed to be run as root? Don't waste your time pressing the up arrow and editing it or retyping it, just do

sudo !!
and it executes the previous command with sudo in front of it. :)

Bou
March 19th, 2009, 10:43 AM
How to wake your computer up (by itself) after 30 minutes:


sudo sh -c "echo $(date '+%s' -d '+ 30 minutes') > /sys/class/rtc/rtc0/wakealarm"
sudo shutdown -P now

See http://ubuntuforums.org/showpost.php?p=6896157&postcount=5
for how to wake your machine up at 5am every day.
Add
cvlc reveille.ogg to /etc/rc.local and you have an alarm clock :)

That's the most amazing computer-related thing I've seen in a while. How come no one has done a GUI for that yet?

sim-value
March 19th, 2009, 11:01 AM
That's the most amazing computer-related thing I've seen in a while. How come no one has done a GUI for that yet?

That doesnt work for me :(

t0p
March 19th, 2009, 11:30 AM
It [tab-completion] doesn't work with sudo.

Yes it does.

t0p
March 19th, 2009, 11:36 AM
To create a hidden file just add a period infront of the file name, such as .file-name-example.txt
.

To un-hide a hidden file, just remove the period from the start of the filename.
:)

t0p
March 19th, 2009, 11:44 AM
Oh yeah, this is a good one: apropos. Say you're looking for a certain command or program that is to do with browsers. Type in the command:


t0p@ubunty:~$ apropos browser
alien-arena-browser (6) - wrapper script to run the Alien Arena browser.
gnome-moz-remote (1) - remote control of browsers.
goad-browser (1) - Graphical GOAD browser
gthumb (1) - an image viewer and browser for GNOME
infobrowser (1) - read Info documents
kdcop (1) - A graphical DCOP browser/client
konqueror (1) - Web browser, file manager, ...
libsmbclient (7) - An extension library for browsers and that can be used...
lynx (1) - a general purpose distributed information browser for ...
sensible-browser (1) - sensible editing, paging, and web browsing
smbtree (1) - A text based smb network browser
viewres (1) - graphical class browser for Xt
w3m (1) - a text based Web browser and pager
www-browser (1) - a text based Web browser and pager
x-www-browser (1) - Web browser, file manager, ...
xfbrowser4 (1) - wrapper script to run user defined browser


I find this one very very useful.

sisco311
March 20th, 2009, 08:31 AM
to open URL's or files from a terminal with the preferred application:



exo-open url's or path/to/files #xfce4

gnome-open http://ubuntuforums.org/showthread.php?t=520091 #gnome

kde-open url's or path/to/files #kde

FuturePilot
March 20th, 2009, 08:40 AM
To create a hidden file just add a period infront of the file name, such as .file-name-example.txt

Another way to do this is to create a file called .hidden and put the names of directories and files you want to be hidden inside of it. This is useful if you want something hidden out of your way but renaming it with a dot in front of it would probably break something.

For example here's the contents of my .hidden

Examples
Templates

This will only work with Nautilus though.

imlinux
March 20th, 2009, 10:07 AM
i don't know if someone has discussed this tip to download/get any video which ever you play in your browser,let the video load first completely,after this go to "/tmp" directory there you can find video file most of the time, copy that file to home you can play it with totem anytime.

olejorgen
March 21st, 2009, 03:38 PM
Here's a litte gem I recently found out about:



In many GTK applications (not all fro some reason) hovering the mouse over a menu item and pressing a key combo. (eg. ctrl + k) assigns this combo as a keybinding for the menu item.

You need to add
gtk-can-change-accels = 1
in you ~/.gtkrc-2.0 first though

kimda
March 21st, 2009, 05:42 PM
alt+. cycle through previous commands or use up down arrows. This is very handy together with ctrl+r and history. You can execute previous commands by using !number. So if 1 in history is ls /home, !1 will execute the same command. Also cd - will return you to last location. Another useful command is pushd.

By entering pushd you will return to the previous directory. Just enter cd /etc and then enter "pushd". You will jump right back from where you came. I never use pushd anymore since I think "cd -" does the same thing and is faster to type. I've put alot of tips on my squidoo page. The link is in my signature.

Another nice tip is add the following line to you're .bashrc
alias upgrade='sudo apt-get update && sudo apt-get upgrade && sudo apt-get clean'

Now you can use the command upgrade to upgrade to upgrade to the latest packages. you can add more aliases or make shell scripts to save time typing those long commands.

MaxIBoy
March 21st, 2009, 11:41 PM
Commands to run in a framebuffered virtual terminal with no X11 running:

mplayer -fb video_file #watch movies

fbi image_file #framebuffered image viewer. Features zooming and panning.
#If you open multiple files with it, you'll be able to use "next image"
#and "previous image" buttons.

Oh yeah, this is a good one: apropos. Say you're looking for a certain command or program that is to do with browsers. Type in the command:


t0p@ubunty:~$ apropos browser
alien-arena-browser (6) - wrapper script to run the Alien Arena browser.
<snip>
I find this one very very useful.
Unrelated, buy I see that you have Alien Arena installed from the repositories. The repository version is almost a year out of date (unless you've installed it from getdeb.)

If you want my personal recommendation, checkout the game from the Subversion repository: svn://svn.icculus.org/alienarena/trunk

Sealbhach
March 21st, 2009, 11:51 PM
If you want my personal recommendation, checkout the game from the Subversion repository: svn://svn.icculus.org/alienarena/trunk

How do you install something with Subversion?


.

MaxIBoy
March 22nd, 2009, 12:40 AM
How do you install something with Subversion?


.
Checkout whatever is in the Subversion repo:

svn co svn://URL_of_svn_repository destination_directory
Destination_directory doesn't have to already exist. If you don't specify destination_directory, it will choose the default directory name of the specific SVN repo you are using.



After that, it depends. Sometimes you get pre-compiled binaries that can be run. Sometimes you get installer scripts. Sometimes you just get source code. You can have an SVN repo of whatever you like. For example, you might checkout the latest draft of someone's book from SVN.




In the case of Alien Arena, you get pre-compiled binaries for Windows and the source code. To get Linux binaries, just compile from source:

cd alienarena
cd source
make clean #if you've already installed this before, you should always make clean, otherwise the two versions will clash
make
make install
cd ..
sudo chmod +x crx.sdl

After that, you can go to the "alien arena" directory you've created and double-click "crx.sdl." Note that "crx" works too, but for most people, sound won't work unless you use "crx.sdl."




Repeat this process whenever you want to update. For Alien Arena, SVN hosts the developers' codebase, so you get new features as soon as they're written.

ninjapirate89
March 22nd, 2009, 01:03 AM
Command line tool for downloading youtube videos


sudo apt-get install youtube-dl

consult
man youtube-dl to learn how to use it

This is not necessary. If you are at say http://www.youtube.com/watch?v=AAdXowU1cBI simply type the word "pwn" in front of youtube as shown http://www.pwnyoutube.com/watch?v=AAdXowU1cBI and it will open to another page with the option to download the video. Only a web browser is needed.

Sealbhach
March 22nd, 2009, 02:08 AM
Repeat this process whenever you want to update. For Alien Arena, SVN hosts the developers' codebase, so you get new features as soon as they're written.

Cool, thanks. It's a bit like wget?

.

unutbu
March 22nd, 2009, 04:57 AM
How come no one has done a GUI for that yet?

Here is a GUI for configuring your machine to automatically wake at a certain time.

Requirements for the script to work:

Your linux kernel version must be >= 2.6.22 (Gutsy and above)
Your BIOS must have support to wake. See http://www.mythtv.org/wiki/ACPI_Wakeup
You must have ACPI enabled. (You can not be booting with the kernel option acpi=off, for example).


Save the attached script at /usr/local/bin/set_wake.py

Make it executable:


chmod 755 /usr/local/bin/set_wake.py

Run:


gksu set_wake.py

So as not to drag this thread off topic, if you run into any problems, please start a new thread, and PM me with the link.

MaxIBoy
March 22nd, 2009, 06:34 AM
Cool, thanks. It's a bit like wget?

.
Subversion is a version control system. If you have a complex project you're working on, you use a VCS. When you modify something, you "commit" a new version. All versions throughout the history of the project are stored. When you want to retrieve a version, you "check out" that version (think "check out a book from the library," not "check out that wierd tree.") It's like hitting "save as" every time you make a change, only:


You don't have thousands of files to sift through.
It keeps track of a whole project, not just one file at a time.
It takes up much less space, because the archive is heavily compressed.

Version control systems include CVS, Subversion (SVN,) Mercurial (Hg,) Bazaar (Bzr,) and Git.

The "svn co" command "checks out" a revision from a subversion archive which is set up to allow downloading over the Internet. Unless otherwise specified, it will pick the most recent revision.

billgoldberg
March 22nd, 2009, 11:21 AM
Generally, if you use scrollwheel, you scroll on whatever window the cursor is over, not necessarily the active window

[


This is one of my favorite features.

t0p
March 22nd, 2009, 11:53 AM
Want to download video from youtube? Easy! Watch the video you want to download. Next, and before you leave that web page, go look in the /tmp directory. There should be a flash video file with a name like "FlashfQ5a1h". That's the file you want. So copy it to your desktop. Job done! :)