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
echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list | |
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_10/Release.key -O- | apt-key add - | |
apt update | |
apt install podman |
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
#!/usr/bin/env python | |
# by: Cody Kochmann | |
from datetime import datetime | |
from functools import partial | |
from ipaddress import ip_address | |
from itertools import cycle, product, islice | |
from random import randint, shuffle |
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 | |
# This script contains the steps needed to shrink a massive table on postgres | |
# when disks did not have enough room to run a VACUUM FULL after major deletions. | |
# by: Cody Kochmann | |
# NOTE - These commands were run manually and will need situation specific | |
# options added if they were ever to be reused. This gist was only to | |
# capture the gist of the steps needed. | |
# set a date to clear logs to |
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
#!/usr/bin/env python3 | |
# by: Cody Kochmann | |
# created: 2023-10-01 | |
# license: MIT | |
''' | |
This script takes a json object from stdin and turns it into a directory tree of files. | |
''' | |
import sys, json, os, contextlib |
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 | |
# by: Cody Kochmann | |
# how to run an interactive gui program from another user on debian 12 | |
# inspired by https://gist.github.com/kasunbg/5502cb630429819d07b5dc0cfa26813c | |
export NEW_USER_NAME=cody-facebook | |
#--------------------------------- | |
# step 1 - create a new 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
# file /etc/fstab | |
# by: Cody Kochmann | |
# license: MIT | |
# description: how I keep cache to per boot lifetimes | |
# Note - pull the uid and gid from /etc/fstab to ensure correct permissions | |
# Note - the "size" can be defined as units like "1G" or percentages like "10%" | |
# configuration for per user cache | |
tmpfs /home/cody/.cache tmpfs defaults,uid=1000,gid=1000,mode=0700,size=10% 0 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
# Author: Cody Kochmann | |
# Date Created: 2023-09-16 | |
# Last Modified: 2023-09-16 | |
# License: MIT | |
# | |
# This makefile spins up an aria2c process for every .magnet file in the current directory. | |
# | |
# It assumes it will be only one magnet link per each .magnet file. | |
# | |
# The benefit of this over just having a single aria2c call pull multiple magnet links from |
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 myIP() { | |
// returns the users ip address | |
// ref link: http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript | |
if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); | |
else xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); | |
xmlhttp.open("GET","http://api.hostip.info/get_html.php",false); | |
xmlhttp.send(); | |
hostipInfo = xmlhttp.responseText.split("\n"); |
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
<? | |
class IP | |
{ | |
# by: Cody Kochmann | |
# returns true if the input is a valid ip address | |
public static function validate($s) | |
{ | |
# returns true if the $s is valid ip address | |
return (int)(!filter_var($s, FILTER_VALIDATE_IP) === false); |
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 https://forum.omz-software.com/topic/1919/stash-shell-like-an-expert-in-pythonista | |
# this script will get pip working on iOS! | |
import requests as r | |
exec(r.get('http://bit.ly/get-stash').text) |
NewerOlder