Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Focusing

souhaiebtar

:octocat:
Focusing
View GitHub Profile
@abhiomkar
abhiomkar / rsync_copy.sh
Created Jun 25, 2011
Rsync - Copy files from remote server with Resume Feature
View rsync_copy.sh
rsync --partial --progress --rsh=ssh user@hostname:/path/to/file /local/destination/path
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jexchan
jexchan / multiple_ssh_setting.md
Created Apr 10, 2012
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active Sep 7, 2021
Set the iTerm tab title to the current directory, not full path.
View current-dir-in-iterm-tab-title.sh
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@pstaender
pstaender / remove_pdf_password.sh
Created Nov 11, 2013
Remove password from protected PDF file with GhostScript
View remove_pdf_password.sh
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf
@fideloper
fideloper / vim_tmux_setup.sh
Last active Jun 24, 2021
Setup Vim+Vundle+Solarized+Tmux in a Vagrant Ubuntu box. This goes with my article on Vim+Tmux here: http://fideloper.com/mac-vim-tmux
View vim_tmux_setup.sh
#!/usr/bin/env bash
# Bash script to automate Vim+Tmux install as written about here:
# http://fideloper.com/mac-vim-tmux
# Test if Git is installed.
# Installing Git is not the job of this script
git --version 2>&1 >/dev/null
GIT_IS_INSTALLED=$?
@salcode
salcode / dump-mamp-mysql-dbs.sh
Created Feb 21, 2014
Shell Script to dump all MAMP DBs into separate files
View dump-mamp-mysql-dbs.sh
# based on http://www.commandlinefu.com/commands/view/2916/backup-all-mysql-databases-to-individual-files
# but modified for the MAMP path and to include default root/root as username and password
for I in $(/Applications/MAMP/Library/bin/mysql -u root -proot -e 'show databases' -s --skip-column-names); do /Applications/MAMP/Library/bin/mysqldump -u root -proot $I | gzip > "$I.sql.gz"; done
@P7h
P7h / jdk_download.sh
Last active Aug 12, 2021
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
View jdk_download.sh
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.