# To build & install your own local copy of git:
wget -N http://kernel.org/pub/software/scm/git/git-1.6.5.1.tar.gz
# (link from http://git-scm.com/ )
tar xf git-1.6.5.1.tar.gz
cd git-1.6.5.1
#
# Turn off support for OpenSSL (used for IMAP over SSL)
# and curl (used for http: and https: repositories)
# These two seem to be broken on Red Hat
#
NO_OPENSSL=1
NO_CURL=1
export NO_OPENSSL
export NO_CURL
#
# You probably don't want to use the default of your home dir
# because it creates 5 dirs for git:
# $ ls ~/git
# bin lib lib64 libexec share
#
./configure --prefix=$HOME/git
make
make install
# then add $HOME/git/bin to $PATH
# Read this:
#
# http://www.kernel.org/pub/software/scm/git/docs/everyday.html
#
# And you should be sorted.
A place for John to record his techy notes, both to refer back to when needed, and as a help for others...
Wednesday, October 21, 2009
Wednesday, October 14, 2009
To export your PuTTY and WinSCP sessions
You can export your settings for these apps from regedit:
PuTTY:
HKEY_CURRENT_USER\Software\SimonTatham
WinSCP:
HKEY_CURRENT_USER\Software\Martin Prikryl
PuTTY:
HKEY_CURRENT_USER\Software\SimonTatham
WinSCP:
HKEY_CURRENT_USER\Software\Martin Prikryl
Tuesday, October 13, 2009
Copying and pasting in screen
When you're in screen and want to copy something...
Go
Then move to where you want to mark, using your vi keys hjkl or the arrow keys.
Press
to set the first mark.
Select the block you want to copy by moving to the second mark
then press
to copy the selected text to the buffer
Then to use the selected text...
Say you want to cat it into a file...
Then go
to paste.
This also lets you go back up into your scrollback.
http://www.samsarin.com/blog/2007/03/11/gnu-screen-working-with-the-scrollback-buffer/ is a good HOWTO for this.
Go
<Ctrl>-A [Then move to where you want to mark, using your vi keys hjkl or the arrow keys.
Press
<Enter>to set the first mark.
Select the block you want to copy by moving to the second mark
then press
<Enter>to copy the selected text to the buffer
Then to use the selected text...
Say you want to cat it into a file...
$ cat > file
Then go
<Ctrl-A> ]to paste.
This also lets you go back up into your scrollback.
http://www.samsarin.com/blog/2007/03/11/gnu-screen-working-with-the-scrollback-buffer/ is a good HOWTO for this.
$ cat ~/.screenrc
vbell_msg '*ding*'
vbell off
defscrollback 20000
scrollback 20000
compacthist on
Monday, October 12, 2009
protocol error: mtime.sec not delimited
If you get an error saying:
When you are using scp to send files to a machine...
Check the login process on that machine to see what messages are being echoed to STDOUT when you login.
If you can get rid of the message (e.g. by not running fortune or doing 'echo "blah"') then the error should go away.
If it's something you want to run on an interactive login, then you could put a test around it to only run it then...
e.g.
protocol error: mtime.sec not delimited
When you are using scp to send files to a machine...
Check the login process on that machine to see what messages are being echoed to STDOUT when you login.
If you can get rid of the message (e.g. by not running fortune or doing 'echo "blah"') then the error should go away.
If it's something you want to run on an interactive login, then you could put a test around it to only run it then...
e.g.
if [ $TERM == "xterm" ]; then
fortune -s
fi
Thursday, October 01, 2009
vi change on matching lines
If you'd like to do something globally on lines that match a string,
without needing to do anything to the string itself...
e.g. find all lines matching <img src=".*> and append </a>
This says:
globally match <img src=".*>
and on the matching lines substitute </a> for $
without needing to do anything to the string itself...
e.g. find all lines matching <img src=".*> and append </a>
:g/<img src=".*>/s%$%</a>%
This says:
globally match <img src=".*>
and on the matching lines substitute </a> for $
Tuesday, September 22, 2009
~/.ssh/config
The fields you most often need in ~/.ssh/config are...
Not to mention the proxy stuff below.
Host HOSTNAME
User USERNAME
HostName IP_ADDRESS (or hostname.fqdn)
Not to mention the proxy stuff below.
Tuesday, September 15, 2009
Extracting files from Solaris packages
How to extract files from a DaTaStReAm package without installing the package on the system:
You use pkgtrans to convert a datastream format package to file system format.
You use pkgtrans to convert a datastream format package to file system format.
$ pkgtrans gzip-1.3.12-sol26-sparc-local .
Monday, September 07, 2009
Thursday, August 06, 2009
Debian Lenny in qemu on Windows
http://homepage3.nifty.com/takeda-toshiya/qemu/
Create an image to install into:
qemu-img.exe create -f qcow qemu_disk.img 3G
Download install image:
http://www.debian.org/CD/netinst/
Copy and change qemu-win.bat
To boot the install image with:
qemu.exe -L . -m 128 -hda qemu_disk.img -soundhw all -localtime -M -cdrom debian-503-i386-netinst.iso
Then to run normally, remove the -cdrom part.
I have also used: -m 256 -cpu pentium3 -M pc -no-reboot -no-acpi -no-kqemu
To do this I copied qemu-win.bat to a new batch file, and edited that to suit my needs and use that to start qemu.
There maybe a few errors when it boots, but nothing serious - and I can run it on a machine where I don't have admin, where I can't install VirtualBox or similar.
If you add:
You can ssh into localhost to get into the machine.
-redir tcp:2222::22 if 22 is already in use...
Other links:
http://lassauge.free.fr/qemu/
http://www.davereyn.co.uk/download.htm ?
Create an image to install into:
qemu-img.exe create -f qcow qemu_disk.img 3G
Download install image:
http://www.debian.org/CD/netinst/
Copy and change qemu-win.bat
To boot the install image with:
qemu.exe -L . -m 128 -hda qemu_disk.img -soundhw all -localtime -M -cdrom debian-503-i386-netinst.iso
Then to run normally, remove the -cdrom
I have also used: -m 256 -cpu pentium3 -M pc -no-reboot -no-acpi -no-kqemu
To do this I copied qemu-win.bat to a new batch file, and edited that to suit my needs and use that to start qemu.
There maybe a few errors when it boots, but nothing serious - and I can run it on a machine where I don't have admin, where I can't install VirtualBox or similar.
If you add:
-redir tcp:22::22You can ssh into localhost to get into the machine.
-redir tcp:2222::22 if 22 is already in use...
Other links:
http://lassauge.free.fr/qemu/
http://www.davereyn.co.uk/download.htm ?
Friday, July 17, 2009
rolling back a commit with git
Get the hash of the version you want...
Check out the version into the current dir:
http://stackoverflow.com/questions/373812/rollback-file-to-much-earlier-version
$ git log
Check out the version into the current dir:
git checkout 45a5b1aa137c07b15f820f49762feb7ec068b3f8 .
http://stackoverflow.com/questions/373812/rollback-file-to-much-earlier-version
Subscribe to:
Posts (Atom)