Skip to content

Instantly share code, notes, and snippets.

View krisives's full-sized avatar
🤣

Kristopher Ives krisives

🤣
  • United States
View GitHub Profile
SUBSYSTEM=="net", KERNEL=="wlp1s0", RUN+="/sbin/iw dev $name set power_save off"
@krisives
krisives / shred-all
Created February 26, 2019 08:50
Shred files in Linux including directory names
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Usage: shred-all <dir>"
exit 1
fi
dir=$1
if [ ! -d "$dir" ]; then
@krisives
krisives / ffjoin
Created January 1, 2019 08:14
Helper script for joining (concatenating) multiple media files together using ffmpeg without using an intermediate text file
#!/usr/bin/env bash
if [ $# -lt 2 ]; then
echo "Usage: ffjoin <joined> <file>..."
exit 1
fi
output=$1
shift
@krisives
krisives / HOWTO.md
Created November 17, 2018 05:02
Fix season/episode named files to be simple

Download the fix-season-names file and place it into /usr/local/bin then anytime you download a file and wish to rename it to a simpler name, run fix-season-names <name of file> on the command line and it will rename the files to a simple name like "S02E03.mkv" or similar.

If you have a lot of files, you can run it like this:

fix-season-names *.mkv *.mp4

If you have files in nested directories you can run it like this:

free(): invalid pointer
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) GLib.SList.g_free (intptr) <0x0005f>
at GLib.ListBase.Empty () <0x0013c>
at GLib.ListBase.Dispose (bool) <0x0000f>
at GLib.ListBase.Finalize () <0x0001d>
at (wrapper runtime-invoke) object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) <0x00068>
@krisives
krisives / savebgs.sh
Created September 18, 2018 10:37
A script that saves the KDE Picture of the Day (POTD) you can set on a cronjob to keep a history of all domains.
#!/bin/bash
today=$(date +%Y-%m-%d)
dir=$(realpath ~/Pictures/Daily)
mkdir -p "$dir"
for path in ~/.cache/plasmashell/plasma_engine_potd/*; do
name=$(basename "$path")
saved="$dir/$today-$name.png"
@krisives
krisives / install.sh
Created August 23, 2018 05:06
Download the userChrome.css and run the commands in install.sh to get a hidden tab bar when only one tab is open in Firefox
cd ~/.mozilla/firefox/*.default/
mkdir chrome
cp ~/Downloads/userChrome.css .
Y I 1C 53 62 7E 56
C C 4B 4C 59 49 46
O E 2 4E 23 7F 5D
M D 0D 48 45 4A 4E
E A C B E 18 4A 6A 56 34
K T H S R 37 46 34 42 22
E O P P B 7B 2E 4E 55 75
Y C R O Y 75 43 29 41 70
C T O N C 6C 70 54 4C 54
A F U S O 59 37
package citydoku;
public class BoardFitness {
public double evaluate(Board board) {
double error = 0;
for (int i = 0; i < 9; i++) {
error += evaluateCell(board, i);
error += evaluateRow(board, i);
error += evaluateColumn(board, i);

IP4 Header

Offset Length Notes
0 1 Version & Header Length
1 1 Type of Service (ToS)
2 2 Total Length
4 2 Packet ID
6 2 Fragment Offset
8 1 TTL