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
db = pymysql.connect(host="localhost",user="root",password="****",database="nextcloud",cursorclass=pymysql.cursors.DictCursor) | |
with db: | |
with db.cursor() as cursor: | |
sql = "SELECT carddata,uri FROM oc_cards WHERE addressbookid='5';" | |
cursor.execute(sql) | |
result = cursor.fetchall() | |
for item in result: | |
vcard = open("/tmp/restored_vcards/"+item["uri"],"w") | |
vcard.write(item["carddata"].decode("utf-8")) | |
vcard.close() |
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
name: Azure App Service CD | |
on: | |
workflow_dispatch: | |
registry_package: | |
types: | |
- updated | |
- published | |
jobs: |
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 | |
TODAY_DAY=$(date +%a | tr '[:upper:]' '[:lower:]') | |
echo "Reading Container in /pools/LXC-Backup" | |
for VMID in $(pvesh get /pools/LXC-Backup/ --output-format json-pretty | jq '.members | .[].vmid'); | |
do | |
if [[ $(pct list | grep $VMID) == *"$VMID"* ]] | |
then | |
echo "CT $VMID - Delete Snapshot" | |
pct delsnapshot $VMID "auto_snap_$TODAY_DAY" |
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
frontend private-tcp | |
bind 10.147.17.42:80 | |
mode tcp | |
default_backend private-pfsense | |
frontend private-tcp-ssl | |
bind 10.147.17.42:443 | |
mode tcp | |
default_backend private-pfsense-ssl |
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
OLDNAME=$(hostname) | |
hostnamectl set-hostname ${1} | |
mkdir -p /etc/pve/nodes/${1} | |
cp -a /etc/pve/nodes/${OLDNAME} /etc/pve/nodes/${1} | |
echo 'A reboot is required, Exit with CTRL-C' | |
read |
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
[Unit] | |
Description=Sentry Cron Container | |
After=docker.service | |
[Service] | |
Restart=always | |
ExecStart=/usr/bin/docker start -a sentry-cron | |
ExecStop=/usr/bin/docker stop sentry-cron | |
[Install] |
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
if [[ $(docker inspect -f {{.State.Running}} $USER 2>/dev/null) ]]; then | |
docker exec -it $USER /bin/sh | |
else | |
echo "Initializing your Docker Environment..." | |
docker run --name $USER --privileged -d docker:dind | |
sleep 1 | |
docker exec -it $USER /bin/sh | |
fi |
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
If (Test-Path "$(Get-Location)\pandoc_html") { | |
Remove-Item -Recurse "$(Get-Location)\pandoc_html" -Force | |
} | |
New-Item -Path "$(Get-Location)\pandoc_html" -ItemType directory | |
Get-ChildItem "$(Get-Location)\*.md" | ForEach-Object { | |
pandoc $_ -f markdown -t html -s -o "$(Get-Location)\pandoc_html\$($_.BaseName).html" | Out-Null | |
} |
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
. . . | |
[Share] | |
. . . | |
hide unreadable = yes | |
hide unwriteable files = yes | |
. . . |
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 | |
cd <INSERT FOLDER TO DOWNLOAD TO> | |
# LOAD GPG KEY | |
echo "Loading GPG Key..." | |
wget http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | |
# LOAD JESSIE | |
echo "Loading dists/jessie..." | |
wget -nv --progress=bar -N -m --no-parent --cut-dirs=1 --reject "*.html*" http://archive.raspberrypi.org/debian/dists/jessie/ |
NewerOlder