Skip to content

Instantly share code, notes, and snippets.

@jcaraballo
jcaraballo / pr.md
Last active Apr 11, 2022
Pull Request Cheatsheet
View pr.md
@jcaraballo
jcaraballo / partition-to-image.md
Last active Aug 29, 2015
Copy partition into image file
View partition-to-image.md

Every now and then I have to reinstall a system from scratch, putting the contents on the side. Before I used to go through the system and decide what to manually copy. Nowadays it's so much easier and relatively cheap to copy the whole thing.

In order to copy the partition /dev/sda1 to an image file:

sudo dd if=/dev/sda1 of=image-file.ddimg bs=4M

(The bs size depends on the hardware)

This will probably work gzipping the image on the fly:

@jcaraballo
jcaraballo / gist:9313651
Last active Aug 29, 2015
Vim Cheatsheet
View gist:9313651
View ssh-cheatsheet.md

#Getting the fingerprints

The one associated to the server's ECDSA public key (the one that's normally shown when ssh-ing for the first time):

$ ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub

Or, if RSA is negociated, the RSA public key

$ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
@jcaraballo
jcaraballo / citrix-ubuntu-64bit.md
Last active Oct 7, 2015
Installing Citrix 12.1 in Ubuntu 64bit
View citrix-ubuntu-64bit.md
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created Mar 6, 2012
How to fork a github repository in bitbucket
View git-branch-between-different-repositories.md

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync