Skip to content

Instantly share code, notes, and snippets.

@InvisibleRasta
InvisibleRasta / configuration.nix
Last active May 11, 2020 17:00
/etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.loader.grub.enable = true;
@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
@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)
# 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
# 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)
#!/bin/bash
option(){
answer=$1;
case "$answer" in
1) rtorrent_restart ;;
2) deluge_restart ;;
3) rtorrent_status ;;
4) deluge_status ;;
5) hdd_usage ;;
@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'"
@InvisibleRasta
InvisibleRasta / gentoo_sysclean.sh
Created November 17, 2018 14:41
Gentoo System mantain
#!/bin/bash
# each item you want to prompt about in order
order=(eix revdep world depclean update ecleanpkg ecleandist news)
# prompt string hash for each item
declare -A prompts=(
[eix]="Sync custom package repository and the Gentoo ebuild repository using eix"
[revdep]="Check for and rebuild missing libraries (not normally needed)"
[world]="Update world"
@InvisibleRasta
InvisibleRasta / .zshrc
Last active April 12, 2020 04:00
My .zshrc with .oh-my-zsh
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# shell-color-scripts from AUR
/opt/shell-color-scripts/colorscript.sh -r
#Enable Syntax Highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Path to your oh-my-zsh installation.
@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