View update_arch.sh
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 | |
COMMANDS_TEMP="$(mktemp)" | |
COMMANDS="$(mktemp)" | |
cat > "$COMMANDS_TEMP" << 'EOF' | |
df -h | |
links https://www.archlinux.org/news/ | |
sudo pacman -Syu | |
pacman -Qi | egrep '^Name[[:space:]]*:|^Packager[[:space:]]*:[[:space:]]*Unknown Packager' | grep -B1 '^Packager' | grep '^Name' | cut -d':' -f2 | xargs pacman -Q |
View gotut-25
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) (z float64) { | |
s := 1.0 | |
min_change := 0.01 |
View range.js
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
var range = function(start, end, mult){ | |
if (end == undefined) { | |
end = start; | |
if (end < 0) { | |
start = end; | |
end = -1; | |
} else if (end > 0) start = 1; | |
else start = 0; | |
} | |
if (mult == undefined) mult = 1; |
View list.js
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
var reverseArray = function(a) { | |
var r = [] | |
for(var i = a.length-1; i>=0 ; i--) { | |
r.push(a[i]) | |
} | |
return r | |
} | |
var prepend = function (v, l) { | |
return {value:v, rest:l} | |
} |
View deep.js
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
var deepEqual = function(o1, o2) { | |
if (typeof(o1) == "object" && | |
typeof(o2) == "object" && | |
o1 != null && | |
o2 != null) { | |
for(var p1 in o1) { | |
if (!deepEqual(o1[p1], o2[p1])) return false | |
} | |
for(var p2 in o2) { | |
if (!deepEqual(o1[p2], o2[p2])) return false |
View gist:ca8f2429b43f84f2abd2
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 -eu | |
eval "$(ssh-agent -s)" | |
trap "ssh-agent -k" EXIT | |
pushd /var/www/montogeek/laravel/docs | |
git submodule update --remote --merge | |
popd |
View gist:13ddbe43d349636dd9e3
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 -e | |
my_vars="MYSQL_SERVER MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD EXTERNAL_ENV" | |
for var in ${my_vars} | |
do | |
if [ -z "${!var}" ] | |
then | |
echo "No ${var} defined" | |
exit 1 | |
fi | |
val="${!var}" |
View sec
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
polgara:~# cat /etc/default/sec | |
#Defaults for sec | |
RUN_DAEMON="yes" | |
DAEMON_ARGS="-conf=/etc/sec.conf -input=/var/log/syslog -pid=/var/run/sec.pid -detach -log=/var/log/sec.log" | |
polgara:~# cat /etc/sec.conf | |
# http://simple-evcorr.sourceforge.net/man.html | |
# http://sixshooter.v6.thrupoint.net/SEC-examples/article.html | |
# http://sixshooter.v6.thrupoint.net/SEC-examples/article-part2.html | |
View getpsoverh.py
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 python | |
# this is only for Solaris | |
# just when i think I have understanded solaris memory usage | |
# I get prstat outputs which sum more than 100% on memory usage | |
# this is apparently a memory overhead caused by sharing of memory between procs. | |
# this program gives a list of proceses | |
# rss memory and not shared mememory |
View graph.py
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 python | |
import requests | |
import os | |
auth = '' | |
def login(): | |
global auth | |
r = requests.post(os.getenv('ZABBIX_URL') + '/api_jsonrpc.php', json = { |
OlderNewer