Computer Science Canada Share your tips, wisdom and finds |
Author: | btiffin [ Sat Jan 10, 2009 11:17 am ] | ||||
Post subject: | Share your tips, wisdom and finds | ||||
A couple GNU/Linux shell tricks Want to know what date next Friday is?
Want to know what commands you most often use?
And so you know; my list command is an alias for view (vi readonly mode), but I got used to a list program back in the DOS days and moved the alias to my Coherent system. Now I'm programmed to type list instead of more, less or view and I alias it everywhere. The programmed response grows more ingrained every year. And what did I learn from that top 10? I should either reorganize my directory structure and where I put files or perhaps work on less simultaneous projects with all the associated back and forth. ![]() I'd be interested to see other favourite tips and tidbits. By the way; IBM's developerworks and publib is an awesome resource; http://www-128.ibm.com/developerworks/aix/library/au-productivitytips.html?ca=dgr-lnxw07UNIX-Office-Tips Cheers |
Author: | Tony [ Sat Jan 10, 2009 3:40 pm ] | ||
Post subject: | RE:Share your tips, wisdom and finds | ||
my best trick...
![]() |
Author: | Unforgiven [ Sat Jan 10, 2009 6:17 pm ] |
Post subject: | RE:Share your tips, wisdom and finds |
Great thread idea. Not sure if this is such a "shell trick" but if you use the command line at all, and don't already know about `screen`... find out about it. It's wonderful. |
Author: | OneOffDriveByPoster [ Sat Jan 10, 2009 8:49 pm ] | ||
Post subject: | Re: Share your tips, wisdom and finds | ||
btiffin @ Sat Jan 10, 2009 11:17 am wrote:
![]() |
Author: | btiffin [ Sat Jan 10, 2009 9:51 pm ] | ||
Post subject: | Re: Share your tips, wisdom and finds | ||
OneOffDriveByPoster @ Sat Jan 10, 2009 8:49 pm wrote: btiffin @ Sat Jan 10, 2009 11:17 am wrote:
![]() I use Konsole; 6 shell windows; one REBOL and one Root Shell waiting for a password running all the time. When I need to transpose information from site to textfile I open a terminal window in Konqueror to fire up vi. I just happen to have learned bad habits with jumping to build; cd ../dir ; back to build ; cd ../../someother ; back to build ; rinse and repeat; (using history and cursor keys) when I develop. This is usually occurring in 4 of the 6 shell windows at any given time. Right now; libguile work; cobc work with Bison parser.y file; embedding Factor; debugging SQLite shell clone embedding; creating a more generic autocong config.in file for all the above, so that's 5. And I always seem to cd back to where I keep my Makefile instead of thinking about how many levels up and over and counting dots for the make commands. Part of the point is; I know it's an issue, first step to fixing anything. ![]() Tony; <he said, joking;> irb? I'm sad for you. ![]() Cheers |
Author: | OneOffDriveByPoster [ Sat Jan 10, 2009 10:46 pm ] | ||
Post subject: | Re: Share your tips, wisdom and finds | ||
btiffin @ Sat Jan 10, 2009 9:51 pm wrote: I just happen to have learned bad habits with jumping to build Ah. Here's a trick:
|
Author: | jernst [ Sun Jan 11, 2009 12:57 am ] | ||
Post subject: | Re: Share your tips, wisdom and finds | ||
![]() |
Author: | Zeroth [ Mon Jan 12, 2009 9:27 am ] | ||
Post subject: | Re: Share your tips, wisdom and finds | ||
jernst @ Sat Jan 10, 2009 9:57 pm wrote:
![]() |
Author: | btiffin [ Mon Jan 12, 2009 11:50 am ] | ||||||
Post subject: | Re: Share your tips, wisdom and finds | ||||||
Need to co-ordinate activity between nodes on a local network? Setup a REBOL server.
Clients can send that server executable code blocks, words, strings or urls etc.
Not to be used if you don't understand how opening ports while exposed to the Internet can be a risky business. Use 4 or 5 more lines of REBOL and write a dialect to screen commands instead of using DO in those cases. Cheers |
Author: | btiffin [ Tue Feb 03, 2009 9:18 pm ] | ||||
Post subject: | Re: Share your tips, wisdom and finds | ||||
Properly detached processes under GNU/Linux
So if you want to start something like say, compviz
Runs the process in the background and detaches the stdin, stdout and stderr handles that are cloned from the parent (your command line shell in this case). nohup sets up the process to ignore normal termination signals (hangup in signal speak). So if you exit the current shell, compviz will keep on hummin' There are other utilities that hide all the magic; like detachtty or screen. But it's good to know how to do this from first principles. And don't think you can get away without detaching stdin; while many commands don't normally ask for input, sometimes they do; rm when it bumps into a permission issue, say when getting rid of an unwanted .svn tree for instance. Cheers, Brian |
Author: | OneOffDriveByPoster [ Tue Feb 03, 2009 11:00 pm ] | ||
Post subject: | Re: Share your tips, wisdom and finds | ||
You can also disown the child process:
|
Author: | btiffin [ Thu Feb 26, 2009 1:29 am ] | ||||
Post subject: | Re: Share your tips, wisdom and finds | ||||
Datestamped log files, Windows Notepad Open an empty text file in Notepad; place
Save as... From then on, when that file is opened in Notepad, you'll get a datestamp as per long date format system settings such as
appended to the end, and the cursor at the bottom of the file ready to take a dated log entry. Cheers |
Author: | saltpro15 [ Fri Feb 27, 2009 10:02 pm ] |
Post subject: | RE:Share your tips, wisdom and finds |
prompt facts! typing chuck norris into a command prompt will cause the universe to end. EDIT rm -rf / does that run from the windows prompt or the linux shell prompt? you just inspired me for a new batch script ![]() |
Author: | saltpro15 [ Sun Mar 01, 2009 7:48 pm ] |
Post subject: | RE:Share your tips, wisdom and finds |
*bump* come on, none of you brilliant people want to answer my little question ? ![]() |
Author: | rdrake [ Sun Mar 01, 2009 8:09 pm ] |
Post subject: | Re: RE:Share your tips, wisdom and finds |
saltpro15 @ Sun Mar 01, 2009 7:48 pm wrote: *bump* come on, none of you brilliant people want to answer my little question ? Linux. FreeBSD won't execute it -- it calls you stupid.![]() |
Author: | Dan [ Sun Mar 01, 2009 9:09 pm ] |
Post subject: | Re: RE:Share your tips, wisdom and finds |
rdrake @ 1st March 2009, 8:09 pm wrote: Linux. FreeBSD won't execute it -- it calls you stupid.
Some linux distros will not let you do it, some ask if you are sure and some just run it. However i think totally blocking it is a bad idea as there are some cases where you acutely want to issue that command. The first that comes to mind (and i have done before) is if you first chroot in to a new environment such that / is not actually / on the partition but the dir you chrooted into. This can happen when you are installing a unix based OS from another unix based OS and you have mounted a harddrive to some path, chrooted into it and then want to delete what is on it (posibly a failed install). After all if you are passing the -f argument to rm you should know what you are getting into :p |
Author: | DemonWasp [ Sun Mar 01, 2009 10:42 pm ] |
Post subject: | RE:Share your tips, wisdom and finds |
Besides, if you don't have write permissions it won't let you delete the file anyway - run as a standard user and that generally won't do anything other than delete your home directory. Run as root, however... |
Author: | btiffin [ Mon Mar 16, 2009 9:12 am ] |
Post subject: | Re: Share your tips, wisdom and finds |
Ever find need for random bits of notes and thoughts? BasKet Note Pads; http://basket.kde.org/ Open it up, add a note, or image or link or ... in a variety of topical "Baskets". Move the mouse out of the window, auto minimizes to the tray. Nice. You'll need to run a real OS, with KDE, but tips and wisdom wise, you should do that anyway. ![]() Cheers |
Author: | btiffin [ Thu Apr 23, 2009 5:22 pm ] |
Post subject: | RE:Share your tips, wisdom and finds |
Tokyo Cabinet, Tokyo Tyrant, Tokyo Dystopia Kick Ass Key Value pair DBM. Engine, Remote Server, Full Text Search Bindings for Ruby, Perl, Lua, Java and the C API. http://tokyocabinet.sourceforge.net/index.html Mikio Hirabayashi could well be the same league as Yukihiro Matsumoto Cheers |
Author: | btiffin [ Fri Jun 05, 2009 9:04 pm ] | ||
Post subject: | Re: Share your tips, wisdom and finds | ||
IPython. Kick ass. Umm, when you need to work in Python. http://ipython.scipy.org/moin/
Mixing Python, sh, parallel computing, plotting, hooks for vi ... just lots. Cheers |