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 | |
# -*- coding: utf-8 -*- | |
""" | |
Use mycli (http://mycli.net/) through ssh | |
Usage: | |
$ mycli-ssh yourhost [extra args passed to mycli] | |
""" |
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 | |
PASS=`pwgen -s 40 1` | |
USER=`pwgen -B 10 1` | |
mysql -uroot <<MYSQL_SCRIPT | |
CREATE DATABASE $USER; | |
CREATE USER '$USER'@'localhost' IDENTIFIED BY '$PASS'; | |
GRANT ALL PRIVILEGES ON $USER.* TO '$USER'@'localhost'; | |
FLUSH PRIVILEGES; | |
MYSQL_SCRIPT |
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
-- Ion main configuration file | |
-- | |
-- This file only includes some settings that are rather frequently altered. | |
-- The rest of the settings are in cfg_ioncore.lua and individual modules' | |
-- configuration files (cfg_modulename.lua). | |
-- | |
-- Set default modifiers. Alt should usually be mapped to Mod1 on | |
-- XFree86-based systems. The flying window keys are probably Mod3 | |
-- or Mod4; see the output of 'xmodmap'. |
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 | |
echo "Removing old files..." | |
[ -f /tmp/hosts.working ] && rm -f /tmp/hosts.working | |
whitelist='/(api.solvemedia.com)/' | |
blacklist='https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts http://sysctl.org/cameleon/hosts https://adaway.org/hosts.txt http://hosts-file.net/ad_servers.txt http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext ' | |
for url in $blacklist; do | |
curl --silent $url >> "/tmp/hosts.working" |
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/python | |
import os | |
import sys | |
import csv | |
import datetime | |
import time | |
import twitter | |
def test(): |
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 | |
recipient_email="" | |
recipient_gpg_pub_key="" | |
sender_gpg_pub_key="" | |
file="$(mktemp)" | |
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0 | |
/usr/sbin/logwatch --detail high > $file | |
test -s $file || exit 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
de.substyle("active-unselected", { | |
background_colour = "#ffffff", | |
-- | |
-- Ion dock module configuration | |
-- | |
-- Create a dock | |
mod_dock.create{ | |
-- Dock mode: embedded|floating | |
mode="floating", |
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
<?php | |
if( php_sapi_name() !== 'cli' ) { | |
die("Meant to be run from command line.\n"); | |
} | |
// Modify this based on site domain | |
$_SERVER['HTTP_HOST'] = 'yoursite.com'; | |
define( 'WP_USE_THEMES', false ); | |
global $wp, $wp_query, $wp_the_query, $wp_rewrite, $wp_did_header; |
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 | |
wget -q https://github.com/atom/atom/releases/latest -O /tmp/latest | |
MATCHEDROW=$(awk -F '[<>]' '/href=".*atom-amd64.deb/' /tmp/latest) | |
LATEST=$(echo $MATCHEDROW | grep -o -P '(?<=href=").*(?=" rel)') | |
VER_LATEST=$(echo $MATCHEDROW | rev | cut -d"/" -f 2 | rev | sed 's/v//g') | |
VER_INST=$(dpkg -l atom | tail -n1 | tr -s ' ' | cut -d" " -f 3) | |
if [ "$VER_LATEST" != "$VER_INST" ]; then | |
wget --progress=bar -q "https://github.com/$LATEST" -O /tmp/atom-amd64.deb --show-progress | |
dpkg -i /tmp/atom-amd64.deb | |
echo "Atom has been update from $VER_LATEST to $VER_INST" |
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
--- | |
- hosts: | |
all | |
gather_facts: no | |
vars: | |
verbose: false | |
log_dir: "log/dist-upgrade/{{ inventory_hostname }}" | |
pre_tasks: | |
- block: | |
- setup: |