Skip to content

Instantly share code, notes, and snippets.

@InvisibleRasta
InvisibleRasta / fortune_teller.py
Created November 16, 2018 02:09
Fortune Teller
# description: a game to simulate a fortune cookie
from random import randint # to generate random number
# load the fortunes
def loadFortunes():
global fortunes
fortunes[0] = "This is great, you're going to be rich and famous!"
fortunes[1] = "I'm sorry, just failure and proverty ahead for you."
@InvisibleRasta
InvisibleRasta / define_variable.py
Last active November 16, 2018 02:15
Variables and Print
# We've defined the variable "meal" here to the name of the food we ate for breakfast!
meal = "An english muffin"
# Printing out breakfast
print("Breakfast:")
print(meal)
# Now update meal to be lunch!
meal = "Pizza"
@InvisibleRasta
InvisibleRasta / ix.sh
Created November 16, 2018 20:26
pastebin at ix.io
#!/bin/sh
####Example 'ix.sh cat foobar'
"${@}" | curl -F 'f:1=<-' ix.io
@InvisibleRasta
InvisibleRasta / sysclean.sh
Created November 16, 2018 20:27
Archlinux clean system
yay -Rscn $(yay -Qtdq)
#pacman-optimize
sudo updatedb
sudo pkgfile -u
yay -Fyy
sudo pacman-db-upgrade
yes | yay -Scc
sudo sync
@InvisibleRasta
InvisibleRasta / repoAddv2.sh
Created November 18, 2018 10:33
Gentoo add ebuild to custom repo
#!/bin/bash
# each item you want to prompt about in order
order=(mkdir cp chown pushd manifest popd)
# prompt string hash for each item
declare -A prompts=(
[mkdir]="Run 'mkdir -p /usr/local/portage/$1'"
[cp]="Run 'cp $3 /usr/local/portage/$1/$2'"
[chown]="Run 'chown -R portage:portage /usr/local/portage'"
#!/bin/bash
option(){
answer=$1;
case "$answer" in
1) rtorrent_restart ;;
2) deluge_restart ;;
3) rtorrent_status ;;
4) deluge_status ;;
5) hdd_usage ;;
# package management
alias pac="sudo pacman -S" # default action - install one or more packages
alias pacu="sudo pacman -Syu" # '[u]pdate' - upgrade all packages to their newest version
alias pacs="pacman -Ss" # '[s]earch' - search for a package using one or more keywords
alias paci="sudo pacman -Si" # '[i]nfo' - show information about a package
alias pacr="sudo pacman -R" # '[r]emove' - uninstall one or more packages
alias pacp="sudo pacman -Rns" # '[p]urge' - purge a package + config files
alias pacl="sudo pacman -Sl" # '[l]ist' - list all packages of a repository
alias pacll="sudo pacman -Qqm" # '[l]ist [l]ocal' - list all packages which were locally installed (e.g. AUR packages)
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@InvisibleRasta
InvisibleRasta / anonupload.py
Created April 10, 2020 21:14
Upload a file to anonfile.com
#!/usr/bin/env python3
import requests
import json
import sys
file = {'file': open(sys.argv[1], 'rb')}
r = requests.post("https://anonfile.com/api/upload", files=file)
content = r.content.decode("utf-8")
json_file = json.loads(content)
@InvisibleRasta
InvisibleRasta / mkalias.fish
Created April 11, 2020 14:06
thif function will create aliases for the fish shell
#make a function in ~/.config/fish/functions called mkalias.fish and put this in
function mkalias --argument key value
echo alias $key=$value
alias $key=$value
funcsave $key
end