Skip to content

Instantly share code, notes, and snippets.

@MaxChinni
MaxChinni / proxy.bash
Created April 13, 2017 11:13 — forked from fernando-basso/proxy.bash
Proxy functions. Place them in $HOME/.bashrc or in a differente file, and then source it from bashrc, or source it manually when needed. The file extension is merely illustrative.
#!/usr/bin/env bash
# gsettings list-recursively org.gnome.system.proxy
# Change de ip address and port number accordingly.
function myProxyOn() {
gsettings set org.gnome.system.proxy mode 'manual' # ' manual / nome / automatic '
gsettings set org.gnome.system.proxy.http host '10.0.0.1'
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.https host '10.0.0.1'

Keybase proof

I hereby claim:

  • I am maxchinni on github.
  • I am maxchinni (https://keybase.io/maxchinni) on keybase.
  • I have a public key ASC3mzLYpyR79n_jcImy18eJTL45icqPnx7CZedqJNXLhwo

To claim this, I am signing this object:

@MaxChinni
MaxChinni / apt-add-key.sh
Created January 19, 2016 22:29
Add keys for apt repositories
#!/bin/bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv "$1"
#!/bin/bash
lock() {
exec 200>/tmp/$(basename $0 .sh).lock
flock -n 200 && return 0 || return 1
}
lock || exit -1
@MaxChinni
MaxChinni / sectotime.sh
Last active September 15, 2015 11:25
bash number of seconds to human readable time
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage:" >&2
echo " $(basename $0) <sec>" >&2
exit 1
fi
function secToTime() {
local s=$1