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
function dothedew() { | |
emptyGmail(); | |
deleteTrashEmailsPermanently(); | |
} | |
function emptyGmail() { | |
var mymail = "me@email.com"; | |
var labels = ['INBOX', 'Archive/CSV', 'Archive/Purchase', 'Builder', 'Junk', 'Logwatches', 'MySQL', 'Notes' ]; // Add your labels here | |
labels.forEach(function(label) { | |
var pageToken; |
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
:global ddnsuser "xxx" | |
:global ddnspass "yyy" | |
:global theinterface "pppoexxx" | |
:global ddnshost chosen.name.here | |
:global ipddns [:resolve $ddnshost]; | |
:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ] | |
:if ([ :typeof $ipfresh ] = nil ) do={ | |
:log info ("no-ip.ro: No ip address on $theinterface .") | |
} else={ | |
:for i from=( [:len $ipfresh] - 1) to=0 do={ |
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
sed -i 's%httpd.port=.*%httpd.port=88%g;s%httpd.https.status=.*%httpd.https.status=disabled%g;' /tmp/system.cfg && cfgmtd -w -f /tmp/system.cfg && reboot |
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 | |
if [[ -f "/usr/sbin/vzlist" ]]; then | |
vzlist -a | awk '/^\s+[0-9]/ { print $1" "$5 }' | while read ct_id ct_host; do | |
echo -ne "${ct_host}\t"; | |
vzctl runscript ${ct_id} $0 | |
done | |
else | |
CPU=$(awk '/processor/ { cpu+=1 }; END { print cpu }' /proc/cpuinfo); | |
MEM=$(awk '/^MemTotal:/ { print $2/(1024*1024) }' /proc/meminfo); | |
DISK=$(df -k | awk '!/^tmp/ && !/^Filesystem/ {mp[$1"-"$2"-"$3]=$3 }; END {for (key in mp){ size+=mp[key]}; print size/(1024*1024)}'); |
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
[alias] | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
ls = log --color --graph --pretty=format:'%Cred%h%Creset [%ad] -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue) <%an>%Creset' --abbrev-commit --date=short | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat | |
lnc = log --pretty=format:"%h\\ %s\\ [%cn]" | |
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | |
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative | |
le = log --oneline --decorate | |
fl = log -u | |
dl = "!git ll -1" |
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 | |
# | |
# This script adds a jailed user and prompts admin to add the pubkey for that user | |
# | |
# Alex Negulescu <alecs@sysops.ro> | |
# | |
# | |
[ $# -ge "4" ] || { echo "Usage : $0 -j JAILROOT -u USER1[,USER2,USERx]" [-k IF PUBKEY IS ASKED FOR]; exit 1; } | |
OPTIONS=$(getopt -o j:u:k --long jaildir:,users:,key -n "$0" -- "$@") |
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/awk -f | |
# | |
# Print validty of a cert from a nmap scan report | |
# | |
# Alex Negulescu | |
# | |
BEGIN { | |
nd=0 | |
start=0 | |
has_ssl=0 |
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
# | |
# mkdir -p /shared/portainer/data/ | |
# docker-compose -f portainer-only.yml -p portainer up -d | |
# | |
version: '3.7' | |
services: | |
portainer: | |
image: portainer/portainer-ce:latest | |
container_name: 'portainer' |
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 | |
cd /var/lib/grafana/; mkdir sqtemp; apk fetch sqlite; tar -C sqtemp/ -xzf sqlite-*.apk ; mv sqtemp/usr/bin/sqlite3 sqlite3; rm -rf sqtemp sqlite-*.apk |
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/sh | |
# | |
# This script should prevent the following suspend errors | |
# which freezes the Dell Inspiron laptop. | |
# | |
# Put it in /usr/lib/systemd/system-sleep/xhci.sh | |
# | |
# The PCI 00:14.0 device is the usb xhci controller. | |
# | |
# kernel: [67445.560610] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16 |
NewerOlder