Skip to content

Instantly share code, notes, and snippets.

View Jmainguy's full-sized avatar

Jonathan Mainguy Jmainguy

View GitHub Profile
@Jmainguy
Jmainguy / git-update-heads
Created July 17, 2019 14:02
git-update-heads for when you make a git mistake and want latest copy
#!/bin/bash
function has-branch {
branch=$1
git branch --no-color | grep -q " ${branch}$"
}
thisbranch() {
git branch --no-color | sed -r -n "s/(\* )(.*)/\2/p"
}
@Jmainguy
Jmainguy / main.go
Created June 19, 2019 14:26
Figure out a type in golang
func parseStuff (stuff string) () {
fmt.Println(stuff)
}
parseStuff(pvc)
outputs
root@d5fe1c33ffb4:/var/www/html# php index.php
Fatal error: Uncaught Exception: Unable to open database: unable to open database file in /var/www/html/index.php:11
Stack trace:
#0 /var/www/html/index.php(11): SQLite3->__construct('/var/www/html/w...', 1)
#1 /var/www/html/index.php(36): ServersDb->__construct()
#2 {main}
thrown in /var/www/html/index.php on line 11
root@d5fe1c33ffb4:/var/www/html# pwd
/var/www/html
def bash(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
rc = p.wait()
return stdout, stderr, rc
# Run check_ssl.py
cmd = '/etc/ssl/private/letsencrypt/check_ssl.py %s' % domain