Skip to content

Instantly share code, notes, and snippets.

@computercam
computercam / vue.config.js
Created August 13, 2018 19:31
Vue CLI 3 Webpack cache busting
module.exports = {
chainWebpack: config => {
config.plugin('html').tap(args => {
args[0].hash = true
return args
})
}
}
@computercam
computercam / psx_extract.sh
Created January 8, 2019 03:13 — forked from jcelerier/psx_extract.sh
Script to extract PSX roms in 7z / bin / ape format.
#!/bin/bash -eux
# Extracts and load PSX games that are distributed in .7z / .ape format.
# Requires : ffmpeg, perl, cdemu, ecm2bin
GAME_FOLDER="$1"
EXTRACT_FOLDER=/tmp/game
rm -rf "$EXTRACT_FOLDER"
mkdir "$EXTRACT_FOLDER"
cp -rf "$GAME_FOLDER"/* "$EXTRACT_FOLDER"
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@computercam
computercam / git-cheat-sheet.md
Created May 29, 2019 16:01 — forked from juristr/git-cheat-sheet.md
My Git cheat sheet

Git Cheat Sheet

Committing and Undoing

Adding file for committing

$ git add <filename>
import subprocess
import re
command = ['qdbus', 'org.kde.plasmashell', '/PlasmaShell', 'org.kde.PlasmaShell.evaluateScript']
command.append("""
var allDesktops = desktops();
for (i=0;i<allDesktops.length;i++)
{
d = allDesktops[i];
d.wallpaperPlugin = "org.kde.image";
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@computercam
computercam / ext4magic_recover_text.sh
Created April 30, 2020 04:09
ext4magic recover text files
# Recover files from ext4magic based on the path to the missing textfile
# After running ext4magic -m /path/to/device, from the directory containing RECOVERDIR, run this script with the path to the directory containing text files you want to recover.
# Example:
# ext4magic_recover_text.sh /home/cameron/lostfiles
function get_timestamp() {
date -d @${1} | cut -d' ' -f1-6 | sed 's/ /_/g'
}
for file in $(grep -Rl $1 ./RECOVERDIR/ 2> /dev/null)
#!/bin/sh
tmp="`mktemp`"
url="https://api.github.com/users/ferrybig/repos?per_page=100"
while [ ! -z "$url" ]; do
echo "Fetching $url..." >&2
curl --dump-header "$tmp" "$url"
url="`< "$tmp" grep Link | grep -oE "[a-zA-Z0-9:/?=.&_]*>; rel=.next" | cut -d'>' -f1`"
done | grep clone_url | cut -d'"' -f4 | while read url;
do
project="`basename "$url"`"
@computercam
computercam / nextcloud-docker-backup.sh
Last active December 18, 2023 05:18
docker nextcloud backup / restore
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
TIMESTAMP=`date +"%Y-%m-%d-%T"`
BACKUP_DIR="${DIR}/${TIMESTAMP}"
APPDATA_DIR="${DIR}/../appdata"
MYSQL_USER="root"
MYSQL_PASSWORD="abc123"
MYSQL_DB="nextcloud_db"
@computercam
computercam / fixvscode.sh
Created December 6, 2020 20:37
VSCodium / CODE-OSS visual studio marketplace product.json
#!/usr/bin/env bash
[[ `uname` == "Linux" ]] && PRODUCT_JSON="/usr/lib/code/product.json"
[[ `uname` == "Darwin" ]] && PRODUCT_JSON="/Applications/VSCodium.app/Contents/Resources/app/product.json"
echo "edit the following file"
echo "$PRODUCT_JSON"
echo ""
echo "find the following property"
echo "extensionsGallery"
echo ""