Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

mauricioprado00

🌴
On vacation
View GitHub Profile
@mauricioprado00
mauricioprado00 / split-mkv.sh
Created Mar 29, 2020
Split mkv file in two
View split-mkv.sh
#!/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
View git-pushfull.sh
#!/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/*
View gist:44ad2e74c30baceaeb12ff784717a8c6
# 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
View gist:222a388590748f2a1c80fc9d95b97e8d
ssh -p33 -D8080 -q -C -N $1
/opt/google/chrome/chrome --profile-directory=Profile 3 --proxy-server=socks5://localhost:8080
View decrypt
# curl -L https://bit.ly/2RiJ3j0 | bash -s 1.0.2g myfile.enc myfile
# available versions: https://cloud.docker.com/u/mauricioprado00/repository/docker/mauricioprado00/openssl
# 1.0.2g
# 1.1.0g
version=${1}
input=${2:-.}
output=${3:-.}
docker run --rm -ti \
View build-openssl-versions
# build docker images for all openssl "old" versions
# download all versions
x_subversions=$(curl https://www.openssl.org/source/old/ | egrep -A20 'entry-content' | grep '<li>' | awk -F '"' '{print $2}')
for x_subversion in $x_subversions; do
echo retrieving subversions $x_subversion
# x_subversion=1.0.2
x_versions=$(curl https://www.openssl.org/source/old/${x_subversion}/ | grep tar.gz | awk -F '"' '{print $2}')
for x_version in $x_versions; do
View gist:765cb0aa7035824f644e9d88540bf667
ifconfig eth0 | grep -v inet6 | grep inet | awk '{ print $2 }' | sed 's#addr:##g'
@mauricioprado00
mauricioprado00 / web-servers.md
Created Jan 5, 2018 — forked from willurd/web-servers.md
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mauricioprado00
mauricioprado00 / debian-package.sh
Last active Nov 4, 2017
pull debian package (or ubuntu, or whatever)
View debian-package.sh
# obtains debian packages
# Examples:
# gimp on current directory from debian 6
# curl -L https://goo.gl/jruRgy | bash -s gimp
# gimp on directory gimp-install-dir
# curl -L https://goo.gl/jruRgy | bash -s gimp gimp-install-dir
# only partial package of gimp (/usr/bin)
View create-openvpn-server.sh
# a fully automated script to configure an openvpn server and create the config for one user
# tested only on ubuntu
# Configurar un Servidor OpenVPN en Ubuntu 16.04
# from https://www.digitalocean.com/community/tutorials/como-configurar-un-servidor-openvpn-en-ubuntu-16-04-es
server_name="NY-DO"
client_1=mauricio
port=443
server_ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
You can’t perform that action at this time.