Skip to content

Instantly share code, notes, and snippets.

sudo yum update
sudo yum upgrade -y
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum check-update
sudo yum install code
source /home/test/eduqueue/env/bin/activate
pip install email-validator
aws configure
sudo yum install build-essential libssl-dev libffi-dev python-dev -y
@get-data-
get-data- / build-tag-push.py
Created April 8, 2020 16:07 — forked from peatiscoding/build-tag-push.py
a script to convert your docker-compose.yml (version 2) with build node to image node; this script required DOCKERHUB_USER environment available.
#!/usr/bin/python
import os
import subprocess
import time
import yaml
import re
user_name = os.environ.get("DOCKERHUB_USER")
@get-data-
get-data- / css_check.js
Created February 19, 2020 19:46
debug css layout
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
#!/bin/bash
basics() {
sudo apt update -y
sudo apt upgrade -y
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
sudo apt -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
sudo apt install git -y
sudo apt install wget -y
@get-data-
get-data- / keybase.md
Created January 6, 2020 15:18
Keybase proof

Keybase proof

I hereby claim:

  • I am get-data- on github.
  • I am kevin_tarvin (https://keybase.io/kevin_tarvin) on keybase.
  • I have a public key ASCFFXrjg8OGkpldvZ-_Pm7IDQetMkB-VIGE5sOh_O2Pvgo

To claim this, I am signing this object:

echo "created for public use and use."
echo "Start with re-install cleanup."
rm -r /etc/dnsdumpster
rm /var/www/html/youtube-ads-list.txt
rm /etc/pihole/youtube-ads.sh
echo "cleanup done."
echo "installing python-pip and dnsdumpster."
apt-get install python-pip
pip install --upgrade pip
pip uninstall dnsdumpster
@get-data-
get-data- / handler.py
Created December 6, 2019 16:06
lambda handler for sqs msg handling
# handler.py
"""AWS Lambda function for transferring files from an S3 bucket to another
S3 bucket on a CreateObject event.
Required env vars:
:param SQS_QUEUE_URL: URL of SQS queue
Optional env vars:
:param LOGGING_LEVEL: string log level (default ERROR)
:param NUM_MESSAGES: int # of msg to retrieve per execution (default 1)
:validation NUM_MESSAGES: accepts int 1 - 10
@get-data-
get-data- / serverless.yml
Last active December 6, 2019 16:07
IAM permissions for SQS and Lambda with cron Event
iamRoleStatements:
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: "*"
- Effect: "Allow"
Action:
- "sqs:SendMessage"
- "sqs:GetQueueUrl"
Resource: "*"
@get-data-
get-data- / upgrade_git.sh
Created June 27, 2019 21:46
Upgrade git to current version
# Source: https://unix.stackexchange.com/questions/33617/how-can-i-update-to-a-newer-version-of-git-using-apt-get
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
git --version
@get-data-
get-data- / prune.sh
Created June 27, 2019 19:38
Clean up local branches after they are deleted on remote
# Look at what will get removed before taking action
git remote prune origin --dry-run
# Prune and delete those branches locally which were deleted on your remote repository
git fetch --prune
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d