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
import json | |
import boto3 | |
def lambda_handler(event, context): | |
instances = ['INSTANCE_ID'] | |
ec2 = boto3.client('ec2', region_name='us-east-1') | |
ec2.start_instances(InstanceIds=instances) | |
return { | |
'statusCode': 200, | |
'body': json.dumps('Started instance ' + instances[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
import praw | |
from datetime import date | |
def postFig(img_name, sub, flair=''): | |
creds = { | |
"client_id":"", | |
"client_secret":"", | |
"user_agent":"script by u/username", | |
"redirect_uri":"http://localhost:8080", | |
"refresh_token":"" |
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 | |
sudo apt update | |
sudo apt install python3-pip python3-dev | |
sudo pip3 install --upgrade pip | |
pip install jupyter | |
jupyter notebook password | |
#sudo su |
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 | |
sudo apt update | |
#sudo apt install neofetch | |
#neofetch | |
#echo 'neofetch' >> ~/.bashrc | |
sudo apt install wget | |
wget -O splunk.tgz '{SPLUNK-DOWNLOAD-URL}' | |
tar -xzvf splunk.tgz |
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 | |
sudo apt update | |
sudo apt upgrade | |
sudo apt install git wget unzip screen neofetch | |
sudo apt autoremove | |
echo neofetch >> .bashrc | |
wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz |
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
# Roku block list | |
#---------------------------------- | |
0.0.0.0 p.ads.roku.com | |
0.0.0.0 tyler.logs.roku.com | |
0.0.0.0 giga.logs.roku.com | |
0.0.0.0 cooper.logs.roku.com | |
0.0.0.0 cloudservices.roku.com | |
0.0.0.0 assets.sr.roku.com | |
0.0.0.0 prod.mobile.roku.com | |
0.0.0.0 wwwimg.roku.com |
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
import requests | |
import json | |
import time | |
from datetime import datetime | |
while True: | |
response = requests.get('https://api.coindesk.com/v1/bpi/currentprice.json') | |
price = response.json().get('bpi').get('USD').get('rate') | |
now = datetime.now() |
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 | |
sudo apt-get install git postgresql | |
curl https://cli-assets.heroku.com/install.sh | sh | |
git clone https://github.com/eliperelman/heroku-grafana.git | |
cd heroku-grafana | |
heroku create | |
heroku buildpacks:add http://github.com/ryandotsmith/null-buildpack.git |
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
public int ordinalIndexOf(String str, String substr, int n) { | |
int pos = str.indexOf(substr); | |
while (--n > 0 && pos != -1) | |
pos = str.indexOf(substr, pos + 1); | |
return pos; | |
} |
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
import requests | |
import time | |
#make sure you change the event name and key below | |
IFTTT_WEBHOOKS_URL = 'https://maker.ifttt.com/trigger/EVENT_NAME/with/key/YOUR_KEY_HERE' | |
BITCOIN_API_URL = 'https://api.coinmarketcap.com/v1/ticker/bitcoin/' | |
BITCOIN_PRICE_THRESHOLD = 9500 | |
def get_latest_bitcoin_price(): | |
response = requests.get(BITCOIN_API_URL) |
NewerOlder