To redirect stdout and stderr in bash we use:
./ShellFile.sh &> test.log
However in tcsh that results in:
Invalid …
To redirect stdout and stderr in bash we use:
./ShellFile.sh &> test.log
However in tcsh that results in:
Invalid …
With a command line Ruby application using Thor for the option parsing I want to be able to run:
$ thor_app …
When creating my blog I have been inconsistent with the tag command line
, Command line
and
Command Line
the case …
Enter copy mode
ctrl-a [
Use cursors of vim motions to move to relevant area.
Space to start selection, space again …
read moreRemoval of substring:
string="test string"
echo $string
remove="test"
short_string=${string#$remove}
echo short_string
Note that inside the ${}
string …
I use gitx
graphical tool on OS X to find the SHAs for commits. Revert back …
Creating new posts in Octopress is rake new_post["Edit Posts"]
which outputs the created filename.
Posts are prefixed with date …
read moreI use to use svn revert
to roll back local modification and get back to the state I was in …
Here are some aliased commands which stop line wrapping on really long lines, making the output much more readable:
# Stop …
setenv allows sub shells to inherit the value.
set x = "twenty"
echo $x
> twenty
## New Shell
csh
echo $x …
cat /etc/redhat-release
Returns some thing like:
Red Hat Enterprise Linux Client release 5.7 (Tikanga)
Find Kernel version using …
read moreTo check if an environment variable exists in .mycshrc or shell scripts
if ($?TERM) then
echo "TERM is $TERM"
endif …
I have decided to clean up my vim colorschemes. I have been using ir_black for sometime but it does not …
read moreTo add static about page to octopress blog, assuming that octopress has been already setup:
Create the page from the …
read moreAfter struggling to get the rake task for octopress to deploy I decided to fall back to the command line …
read moresudo lshw -class disk -class storage -short
Outputs :
H/W path Device Class Description
=====================================================
/0/100/1c.3/0 …
To capture the screen on OS X :
⇧⌘4 : Selected area to capture.
⇧⌘4-space : Capture a window.
These are defined in …
read moreFor code reuse within I have found Subversion externals really nice to work with. Instead of copy and pasting code …
read moreTHIS NO LONGER WORKS, IF IT EVER DID :(
When you add a link to safari, it replaces the link to …
read moreThere is currently a preview (Beta) of [Little Snitch 3][littelsnitch3]. If you have not come across Little …
read moreFollowing on from Macbook Pro Setup, Now it is time to install some of the command line tools.
I have …
read more/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
To Reset it back to this value run (from /Applications/Utilities …
read more/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
To Reset it back to this value run …
read moreOne of the limitations of mountain lion is that they are only going to support 64 bit Kernel extensions, the …
read moreWhen working behind a restrictive firewall, which limits ssh connections you may be running into some of the following errors …
read moreI started off following the ubuntu guide for installing a new drive, which uses fdsik to create the partitions how …
read moreUpdate RVM
$ rvm get head
List current versions, and all versions
$ rvm list
$ rvm list known
Select the version you …
read moreSometime a script needs to now the directory that it is executing from, the best solution for this is:
DIR …
Entering the following command in to your .bashrc seems like a simple way forward.
xmodmap -e "remove lock = Caps_Lock"
However …
read moreIf you are working on a new system or with multiple environments it is good to know what type of …
read moreAnswer:
svn commit -m $'Line 1 \nLine 2'
Committing to subversion on the command line and using escaped …
read moreCron jobs can have there results returned as mail via the unix mail system. If left unchecked for a while …
read moreA simple script for finding temp files from the current directory and below. I often run this before adding a …
read moreI have just added the method below to my ruby .irbrc file for quickly calculating image megapixels. from OS X …
read moreI noticed today that greps recursive function is different to finds recursion.
find ./ -name *.txt
grep -R 'text' *.text
The …
read moreSuppressing warnings is usually a bad idea but if you understand the risk and want to carry on regardless. When …
read moreThis assumes that origin
is the label for github.
Tagging a github repo for my gem releases I do:
$ git …
A small standalone script that search through a file doing text substitutions.
1 2 3 4 5 6 7 8 … |
Do you some times see:
FileUtils.rb:93: warning: already initialized constant OPT_TABLE
FileUtils.rb:1176: warning: already initialized constant …
Install Avahi, it like bonjour auto discovery but for linux, then tell it about your servers samba service.
$ sudo apt-get …
Using ssh to securely connect with servers from the terminal is pretty easy. set up a public key and a …
read morerecenlty after updating rubygems Istarted getting a lot of warning like this when running ruby or executable gems:
NOTE: Gem …
read moreI have not fully read it but it looks like this is a good guide to bash scripting. A few …
read moreIf a torrent application has been running and torrents start showing a status of 'unregistered torrent' a likely cause is …
read moreUsing a while true loop with 'gets' and a case statement, can create a compact command line interface for ruby …
read moreAfter making a few updates to my site I decided to upgrade the version of sinatra I was using in …
read moreConsidering various raid strategies I decided that Raid 5 would be too limiting and have previously found raid striping systems …
read moreI have been running into issues with screen when switching to another user:
$ su otheruser
> password
$ screen -x
> Cannot open …
I think it is good practise to create a read only tag when releasing an application. This allows you to …
read moreCurrently OS X 10.6.3 - 10.6.5 the ncursers library is broken. A hacky fix is to copy …
read moreFor various reasons Mac OS X (at least 10.6) can get the system cache out of sync with the …
read moreRack applications often require a config.ru for deployment. The standard config.ru for classic sinatra applications is well documented …
read moreTo Stop Start and Restart Samba on Mac OS X 10.6:
sudo /usr/sbin/smbd stop
sudo /usr/sbin …
As this seemed to be a useful post on my old blog I am reposting it. Just in case the …
read moreWhen running a sequel migration I kept getting this error:
Error: NoMethodError: undefined method `compact' for nil:NilClass
My setup …
read moreGrep is a unix (and mac os x) command line tool to search files for text.
1) Search for all …
I have been wondering how to do this for a while and accidentally discovered it while perusing this heroku page …
read moreFollowing this article lets you turn a executable java .jar into a mac appliction (.app). The Tools are only available …
read moreAfter adding some USB2 (NTFS formatted) drives to a headless Ubuntu server, they were not auto-mounted so I had to …
read moreHomebrew is a new package management system for Mac OS X. A good review/tutorial on EngineYard.
Update 20-August-2010
Then …