Skip to content

Instantly share code, notes, and snippets.

@jcaraballo
jcaraballo / pr.md
Last active April 11, 2022 13:04
Pull Request Cheatsheet
@jcaraballo
jcaraballo / partition-to-image.md
Last active August 29, 2015 14:01
Copy partition into image file

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 August 29, 2015 13:56
Vim Cheatsheet
@jcaraballo
jcaraballo / ssh-cheatsheet.md
Last active October 29, 2016 23:16
SSH Cheatsheet

#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 October 7, 2015 06:17
Installing Citrix 12.1 in Ubuntu 64bit
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

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