Skip to content

Instantly share code, notes, and snippets.

@salopst
salopst / bash-iterate-files.sh
Last active October 4, 2018 07:42
bash loop files
#!/bin/bash
FILES=./*
for f in $FILES
do
echo "Processing $f file..."
# take action on each file. $f store current file name
cat $f
done
@salopst
salopst / re-route-pihole.sh
Last active October 5, 2018 11:43
pi-hole keeps rerouting through olde 172.16 network...
#!/bin/bash
sudo route delete -net default gw 172.16.2.0 metric 202 dev eth0
sudo route add -net default gw 192.68.2.1 metric 202 dev eth0
@salopst
salopst / resize-la.sh
Created October 4, 2018 15:20
use imagemagik to resize to longest axis
#!/bin/bash
#
# 2018-10-04
# yearlux@xolotl
#
# use imagemagik to resize to longest axis
if [[ `uname` == 'Darwin' ]]
then
@salopst
salopst / netset.sh
Created October 10, 2018 05:05
reset network on omv
#!/bin/dash
# 2019-10-09
# reset network on omv
# sudo ip address show
# sudo ip route show
# echo $0
# env
# check also /etc/hostname/

2021-02-11

yearluk

make icloud nativefier app for ical...

"Nativefier is a command-line tool to easily create a desktop app for any web site with minimal configuration. Apps are wrapped by Electron" https://github.com/nativefier/nativefier

mkdir -p ~/tmp/icloud-nativefier-build-dir
cd ../tmp/icloud-nativefier-build-dir
@salopst
salopst / validate-yaml.rb
Created September 19, 2021 05:40
Bulk validate YAML... in this case to track down a Jekyll error: "The value '{}' was passed to a date-related filter that expects valid dates in /_layouts/default.html or one of its layouts."
#!/usr/bin/env ruby
# 2021-09-19
# https://stackoverflow.com/questions/34150923/bulk-validating-yaml-files
require "yaml"
def check_file(filename)
YAML.parse_file(filename)
puts "OK"
@salopst
salopst / 2021-07-13-ubuntu-post-install.sh
Created September 19, 2021 13:01
Running list of apps and stuff installed following Pop OS install Jul 2021
#!/bin/bash
# 2021-07-13/2021-09-19
# yearluk@t460.maranlan
# $HOME/.dotfiles/_startup/ubuntu-post-install.sh
#
# - Not intended for script-running
# - Very GNOMEy -- Something for non-APT package managers ??
# - Emacs sold seperately
@salopst
salopst / t460-kmonad.kbd
Last active October 1, 2023 06:01
Stripped down KMonad keymapping just for laptop... the fecker with the busted up arrow. Maintains capslock-->ctrl, Vim keys on holding space, and spacecadet parens on shifts
#|
;; ---
;; title: MINIMAL config for KMonad on Lenovo Thinkpad T460
;; date: 2022-07-20T07:34:45+01:00
;; lastmod: 2023-10-01T04:14:46+0100
;; filename: $XDG_CONFIG_HOME/kmonad/t460-komnad.kbd
;; ---
;; ##### VERY STRIPPED DOWN CONFIGURATION FILE FOR KOMNAD -- T460 ONLY #####
\#
@salopst
salopst / .XCompose
Last active July 21, 2024 06:45
~/.XCompose
#---
#title: Extends X11 Compose Key Base at /usr/share/X11/locale/en_US.UTF-8/Compose
#date: 2007-11-14
#lastmod: 2024-7-21T0:45:21+0100
#filename: $HOME/.XCompose
#refs:
#- https://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre
#- https://wiki.debian.org/XCompose
#- https://unicode-table.com/en/search/
#---
! name: Baby's First Brave Browser Bullshit Filter
! description: Rando collection of sites I fucking hate and want to block.
! public: false
! author: Salopst
$discard,site=pinterest.co.uk
$discard,site=pinterest.com
$discard,site=dailymail.co.uk
$discard,site=dailymail.com
$discard,site=bloomberg.com