This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
original_device=/dev/sdb | |
copy_device=/dev/nvme0n1 | |
function get_partition_prefix | |
{ | |
local device="$1" | |
ls ${device}* | grep -v '^'${device}'$' | sort | head -n1 | sed 's#[0-9]$##g' | |
} | |
function get_password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# will return zero if mutex is successful, any other code for error | |
function mutex() | |
{ | |
#adapted from http://wiki.bash-hackers.org/howto/mutex | |
local LOCKDIR=$1 | |
local PIDFILE="${LOCKDIR}/PID" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 1: Set priveleges | |
$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all | |
Starting... | |
Setting allow all users to YES. | |
Setting all users privileges to 1073742079. | |
Done. | |
# Step 2: Allow VNC clients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Intellimage | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Open Software License (OSL 3.0) | |
* that is bundled with this package in the file LICENSE.txt. | |
* It is also available through the world-wide-web at this URL: | |
* http://www.opensource.org/licenses/osl-3.0.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
file=$1 | |
time1=$2 | |
time2=$3 | |
echo "Two commands" | |
time ffmpeg -v quiet -y -i ${file} -vcodec copy -acodec copy -ss 00:00:00 -t ${time1} -sn part_1_${file} | |
time ffmpeg -v quiet -y -i ${file} -vcodec copy -acodec copy -ss ${time1} -t ${time2} -sn part_2_${file} | |
# see https://stackoverflow.com/questions/5651654/ffmpeg-how-to-split-video-efficiently |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# one-liner: | |
# curl -L https://goo.gl/H7iAZn | bash | |
# one liner with params: | |
# curl -L https://goo.gl/H7iAZn | bash -s myalpinedir x86_64 v3.4 | |
# one liner from yandex: | |
# curl -L https://goo.gl/H7iAZn | MIRROR_FILTER=yandex bash -s myalpinedir x86_64 v3.4 | |
chroot_dir=${1:-alpine} | |
arch=${2:-x86} #x86_64 | |
branch=${3:-latest-stable} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ -z "$1" || -z "$2" ]]; then | |
echo usage: | |
echo " git pushfull <remotename_orig> <remotename_dest>" | |
exit 1 | |
fi | |
git push "$2" refs/remotes/$1/*:refs/heads/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -p33 -D8080 -q -C -N $1 | |
/opt/google/chrome/chrome --profile-directory=Profile 3 --proxy-server=socks5://localhost:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List ignored files | |
git ls-files . --ignored --exclude-standard --others | |
# List untracked files | |
git ls-files . --exclude-standard --others | |
# https://stackoverflow.com/questions/3538144/how-do-you-git-show-untracked-files-that-do-not-exist-in-gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage go [params] | |
docker run -it --rm --name my-running-app -v $(pwd)/:/go/src -w /go/src/ golang:1.8 go $@ | |
# save it with: | |
# curl https://gist.githubusercontent.com/mauricioprado00/8ac58efebd6b7e94d043438cd9a1dbc6/raw/docker-go > /usr/local/bin/go | |
# chmod +x /usr/local/bin/go |
NewerOlder