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 | |
# Install basic kit / configure unattended-upgrades | |
apt install -y fail2ban git-all unattended-upgrades | |
apt update | |
apt -y upgrade | |
echo -e "APT::Periodic::Update-Package-Lists \"1\";\nAPT::Periodic::Unattended-Upgrade \"1\";\n" > /etc/apt/apt.conf.d/20auto-upgrades | |
# Alternatively 'dpkg-configure unattended-upgrades' and go through the graphical menu | |
# Setup non-root user |
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 | |
# Dependencies | |
apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
# GPG Key | |
echo "Docker GPG Key: 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88" | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
apt-key fingerprint 0EBFCD88 |
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 | |
apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 0x836CC41976FB442E | |
echo "deb http://www.tataranovich.com/debian stretch main" >> /etc/apt/source.list | |
echo "deb-src http://www.tataranovich.com/debian stretch main" >> /etc/apt/source.list | |
apt install mc |
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
from twitter import * | |
api = Twitter(auth=OAuth(token, token_secret, consumer_key, consumer_secret)) | |
tweeter_screen_name = "<screen_name not user_name>" | |
# finds most recent replies, need to parse them for actual tweet made | |
replies = api.search.tweets(q='to:%s' % tweeter_screen_name, count=100, result_type='recent')['statuses'] |
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
'use strict'; | |
//replace jquery/jquery with the repo you're interested in | |
fetch('https://api.github.com/repos/numpy/numpy/stats/contributors') | |
.then(response => response.json()) | |
.then(contributors => contributors | |
.map(contributor => contributor.weeks | |
.reduce((lineCount, week) => lineCount + week.a - week.d, 0))) | |
.then(lineCounts => lineCounts.reduce((lineTotal, lineCount) => lineTotal + lineCount)) | |
.then(lines => window.alert(lines)); |
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 getTasks($path) { | |
$out = @() | |
# Get root tasks | |
$schedule.GetFolder($path).GetTasks(0) | % { | |
$xml = [xml]$_.xml | |
$out += New-Object psobject -Property @{ | |
"Name" = $_.Name | |
"Path" = $_.Path | |
"LastRunTime" = $_.LastRunTime |
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
::recursively rename specified files in folder | |
for /R %x in (*.#tiff) do ren "%x" *.tiff |
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
#TODO: Restart if no response | |
leader=$(factom-cli get heights | grep Leader | cut -c 15-) | |
current=$(factom-cli get heights | grep Directory | cut -c 23-) | |
difference=$(($leader - $current)) | |
#echo Current Height: $current | |
#echo Leader Height: $leader | |
#echo Difference: $difference | |
if (($difference > 3)) |
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
#post web request | |
invoke-webrequest -UseBasicParsing -Uri 35.167.205.1:8088/v2 -Method POST -ContentType "application/json" -Body @{"jsonrpc"="2.0", "id"="1", "params"=nil, "method"="heights"} |
NewerOlder