Skip to content

Instantly share code, notes, and snippets.

View davisokoth's full-sized avatar

Davis O. davisokoth

View GitHub Profile
@davisokoth
davisokoth / cleanup_ubuntu_root_space.sh
Last active September 26, 2023 06:00
Addressing Ubuntu running out of space in root
#
# Copied from https://forums.linuxmint.com/viewtopic.php?t=338648
sudo apt autoclean
sudo apt autoremove --purge
sudo find /tmp -type f -delete
dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge
rm -v -f ~/.cache/thumbnails/*/*.png ~/.thumbnails/*/*.png
# This next command failed for me
# sudo journalctl --vacuum-time=1s
@davisokoth
davisokoth / ffmpeg_firefox_support.sh
Created October 3, 2022 11:53 — forked from silgon/ffmpeg_firefox_support.sh
ffmpeg firefox support
ffmpeg -i input.mp4 -vcodec libx264 -acodec mp2 -pix_fmt yuv420p output.mp4
@davisokoth
davisokoth / autopgsqlbackup
Created May 30, 2018 19:52 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@davisokoth
davisokoth / post-merge
Created February 27, 2018 07:29 — forked from GianlucaGuarini/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
@davisokoth
davisokoth / SampleCode.ts
Created January 31, 2018 13:54
Sample Code to strip data from an excel file and upload to server
NON_EDITABLE_STATES = ['DR', 'IN', 'IP', 'RA'];
SHEET_1_NAME = 'Facility ARV CDRR_MoH730Bb';
SHEET_2_NAME = 'Facility_ARV_MAPS_MoH729B';
FILE_VERSION = 'VER 0.1';
CDRR_UPPER_BOUNDS = 13;
CDRR_LOWER_BOUNDS = 72;
SKIP_ROWS = [15, 19, 21, 30, 36, 39, 52, 63, 69,];
site_id = 1023303;
tool_id = 1000000;
codeX = 9;