Skip to content

Instantly share code, notes, and snippets.

@tmiland
tmiland / pulseaudio_gnome_core.sh
Last active August 22, 2025 11:17
Install pulseaudio on gnome desktop on debian 13
#!/usr/bin/env bash
# Delete pin file before updating
if [ -f /etc/apt/preferences.d/gnome-core ]; then
sudo rm /etc/apt/preferences.d/gnome-core
fi
# Run apt update to get latest version
sudo apt update
# Download latest gnome-core package
apt-get download gnome-core
@tmiland
tmiland / TIMESHIFT.md
Created August 6, 2025 09:50 — forked from harilvfs/TIMESHIFT.md
Timeshift GRUB Boot Integration for EXT4 & BTRFS with Legacy BIOS/MBR and UUID Support

Timeshift GRUB Boot Integration (EXT4 & BTRFS)

This guide will show you how to:

  • Create and manage Timeshift snapshots
  • Boot into the latest Timeshift snapshot from GRUB
  • Automatically update the GRUB menu with new snapshots
  • Set up Timeshift for both EXT4 (rsync) and BTRFS
  • Use both blkid and non-blkid (Legacy BIOS/MBR) methods

#!/usr/bin/env bash
# Copyright (C) 2019 Cloudfence - Julio Camargo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@tmiland
tmiland / import_zsh_history_to_bashhub.sh
Last active November 25, 2022 18:46
Script to import zsh history to bashhub server
#!/usr/bin/env bash
# Execution time was ca. 50 minutes for 10000 lines
# Cleans out everything before ; e.g ": 1548515910:0;"
cat $HOME/.zsh_history | cut -d \; -f 2 | uniq > $HOME/.zsh_history_clean
# Cleaned tmpfile
filename=$HOME/.zsh_history_clean
# Do the work
while read -r line; do
@tmiland
tmiland / clone_all_repos.sh
Last active November 14, 2022 20:58 — forked from clrung/clone_all_repos.sh
Clones all repos in a GitHub organization
#!/bin/bash
# Usage: clone_all_repos.sh [organization] <output directory>
ORG=$1
PER_PAGE=100
GIT_OUTPUT_DIRECTORY=${2:-"/tmp/${ORG}_repos"}
if [ -z "$GITHUB_TOKEN" ]; then
echo -e "Variable GITHUB_TOKEN isn't set! Please specify your GitHub token.\n\nMore info: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/"
exit 1
@tmiland
tmiland / atomsetup.sh
Created November 13, 2022 19:18 — forked from anriseth/atomsetup.sh
Install Atom from source
# Ask admin to install the following packages:
# build-essential git libsecret-1-dev fakeroot rpm libx11-dev libxkbfile-dev libgnome-keyring-dev
# When that is done, you can install everything else locally
# Install Node.js
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
source $HOME/.bashrc
nvm install v6.10.3
nvm use v6.10.3
<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
<id>com.obsproject.Studio.Plugin.backgroundremoval</id>
<extends>com.obsproject.Studio</extends>
<name>obs-backgroundremoval Plugin</name>
<summary> An OBS plugin for removing background in portrait images (video), making it easy to replace the background when screen recording.</summary>
<url type="homepage">https://github.com/royshil/obs-backgroundremoval</url>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
</component>
@tmiland
tmiland / cloudflare-delete-all-records.sh
Created February 27, 2021 04:47 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
[email protected]
KEY=11111111111111111111111111
ZONE_ID=2222222222222222222222222
curl -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
-H "X-Auth-Email: ${EMAIL}" \
-H "X-Auth-Key: ${KEY}" \
-H "Content-Type: application/json" | jq .result[].id | tr -d '"' | (
@tmiland
tmiland / freekudos.js
Last active January 23, 2020 14:42 — forked from et/freekudos.js
Kudos everyone in your strava feed
document.querySelectorAll('button.js-add-kudo').forEach(node => node.click())
@tmiland
tmiland / get_amazon_ips.sh
Created October 27, 2019 11:23
AWS IP address blocklist - To be used with Nginx Bad Bot and User-Agent Blocker
#!/usr/bin/env bash
## Author: Tommy Miland (@tmiland) - Copyright (c) 2019
if [[ "$EUID" -ne 0 ]]; then
echo -e "Sorry, you need to run this as root"
exit 1
fi