Skip to content

Instantly share code, notes, and snippets.

@moritztim
moritztim / aicode.zsh
Last active February 10, 2024 09:07
ShellGPT Extras
#!/bin/zsh
## Generate code with Shell GPT's code role and watch it being written in VSCode
aicode() {
# Check if input is available from the pipe
if [ -t 0 ]; then
# If no input from pipe, pass only the prompt to the AI
sgpt --code "$@" | codium -
else
# If input is received from pipe, concatenate it with the provided prompt
@ThioJoe
ThioJoe / Appx-Uninstaller.ps1
Last active April 18, 2025 00:40
A basic script for uninstalling a list of app packages in Windows 10/11, including those pre-installed with Windows
# A basic script for uninstalling app packages in Windows 10/11, including those pre-installed with Windows
#
# Note: If you get an error about the script not being allowed to run, the below command will change the execution polciy temporarily for one session only:
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
#
# To execute the script, open a Powershell window to the directory with the script and run the following command using your scripts file name (and don't forget the .\ )
# .\WhateverScriptName.ps1
# -------------------------------------------------------------------------------------------
# Script by ThioJoe - https://github.com/ThioJoe
'''
Author : Febi Mudiyanto
Date : 23/01/2022
'''
import os
import telebot
from dotenv import load_dotenv
# load API_KEY from .env
@preraku
preraku / playlist_preview_urls.py
Created December 29, 2021 05:19
Get Spotify track preview URLs from Spotify playlists
import base64
import requests
GET_NEW_ACCESS_TOKEN = False
if GET_NEW_ACCESS_TOKEN:
# Create and send an authorization request to Spotify
client_id = 'CLIENT_ID'
client_secret = 'CLIENT_SECRET'
auth_url = 'https://accounts.spotify.com/api/token'
@romanhaa
romanhaa / run.sh
Last active June 14, 2024 12:43
macOS settings
# https://macos-defaults.com/
# https://www.defaults-write.com
# reset with: defaults delete -g <FEATURE>
# dock
# position
defaults write com.apple.dock "orientation" -string "right"
# icon size
defaults write com.apple.dock "tilesize" -int "36"
@lucasaba
lucasaba / update-reboot-check.sh
Created August 28, 2019 08:57
A script that sends a telegram message when an ubuntu server needs update or reboot
#!/bin/bash
IFS=';' read updates security_updates < <(/usr/lib/update-notifier/apt-check 2>&1)
HOSTNAME=`hostname`
BOT_TOKEN='THISTOKENISFROMBOTFATHER'
# Numeric id of the chat to publish messages to
CHAT_ID=1234567890
if [ ! -f ".update-check-status" ] ; then
echo "0:0" > .update-check-status
fi
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active April 11, 2025 10:35
Ubuntu and Debian Cloud images in Proxmox
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@RichardBronosky
RichardBronosky / touchid_sudo.sh
Last active October 31, 2024 19:34
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active April 17, 2025 05:11
crack activate Office on mac with license file