Terminal tips Cheat Sheet

A cheat sheet in English by ridermansb
11,004 views 3,127 downloads 28 Jun 2015 History
3.7 avg · 0 ratings

Multiples git user same computer

Generate new ssh: ssh-keygen -t rsa -C "­you­r-e­mai­l-a­ddr­ess­"
> Use a new file name like: id_rsa­_OT­HERUSER
Add new ssh: ssh-add /.ssh/­id_­rsa­_OT­HERUSER
Open/c­reate a config file vim /.ssh/­config
Add a new Host config­uration like:
------­---­-------
Host github­-OT­HERUSER
HostName github.com
User git
Identi­tyFile ~/.ssh­/id­_rs­a_O­THE­RUSER

Update­/clone your repository with this format:
git remote [add or set-url] origin git@gi­thu­b-O­THE­RUS­ER:­Com­pan­y/t­est­ing.git
* git clone git@gi­thu­b-O­THE­RUS­ER:­Com­pan­y/t­est­ing.git

> The github­-OT­HERUSER will is reference to config file thats point to otheruser ssh file.

git config user.name "­OTH­ER_­USE­RNA­ME"
git config user.email "­OTH­ER@­EMA­IL"

Linux Drivers

List
sudo fdisk -l
Mount
sudo mount /dev/sdb1 /media/usb
Umount
sudo umount /media/usb
Format
sudo mkfs.vfat /dev/sdb1
Burn ISO
sudo dd if=/pa­th/­to/­ubu­ntu.iso of=/de­v/sdb bs=1M
Eject
sudo eject /dev/sdb1

OS

Copy directory: cp -Rp source source­_copy
Check wifi signal: watch -n1 iwconfig
* Copy to clipboard{Command} | xclip -selection clipboard

Android

Listing all AVDs: ls ~/.and­roi­d/avd/
Run emulator: emulator -avd {avd_name} -qemu -m 512 -enabl­e-kvm
Deleting an AVD: android delete avd -n {avd_name}
Install APK: adb -s emulat­or-5554 install jsHybu­gge­r.apk

Sync git fork repo

Add the remote "­ups­tre­am": git remote add upstream " target="_blank">https://{{url}}
Fetch all the branches: git fetch upstream
Go to master branch:
git checkout master
Rewrite your master branch: git rebase upstre­am/­master
* Update:
git push -f origin master`

From stacko­verflow

ffmpeg

* Speedup video: ffmpeg -i input.mkv -r 16 -filter:v "­set­pts­=0.5­*P­TS" output.mkv from docs

Badges

Nice Cheat Sheet Good Cheat Sheet

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.