Skip to content

Instantly share code, notes, and snippets.

View r4mp's full-sized avatar

r4mp

View GitHub Profile
@r4mp
r4mp / iterm2_switch_automatic.md
Created May 2, 2024 07:54 — forked from FradSer/iterm2_switch_automatic.md
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@r4mp
r4mp / README.md
Created May 2, 2024 07:53 — forked from jamesmacfie/README.md
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@r4mp
r4mp / .skhdrc
Created May 1, 2024 07:47 — forked from eramdam/.skhdrc
yabai/skhd config
#!/usr/bin/env sh
:: default : yabai -m config active_window_opacity 1; yabai -m config normal_window_opacity 1;
# Focus
shift + alt - home : yabai -m window --focus north
shift + alt - j : yabai -m window --focus north
shift + alt - end : yabai -m window --focus south
shift + alt - k : yabai -m window --focus south
shift + alt - delete : yabai -m window --focus west
@r4mp
r4mp / del_cluster.sh
Created February 26, 2024 10:21 — forked from ianchen06/del_cluster.sh
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
# edit through sqlite, check, delete, verify
@r4mp
r4mp / din-letter.typ
Created September 22, 2023 11:55 — forked from reknih/din-letter.typ
A DIN letter template like the one we use at Typst
/*
DIN Letter template
Save this file in your project. Use it like this
in your project file:
#import "template.typ": *
#show: letter.with(
sender: [
@r4mp
r4mp / centos_daemontools.txt
Created June 17, 2022 15:19 — forked from toddlers/centos_daemontools.txt
Installing daemontools in centos
1. Install wget gcc and wget
yum install gcc wget
2. Create a folder setup and wget the source
mkdir -p /package
chmod 1755 /package
cd /package
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
tar -xzvf daemontools-0.76.tar.gz
rm daemontools-0.76.tar.gz
@r4mp
r4mp / PVE-HP-ssacli-smart-storage-admin.md
Created March 3, 2022 08:56 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@r4mp
r4mp / rescan.sh
Created March 3, 2022 08:30 — forked from rafaelfoster/rescan.sh
Rescan the devices (can detect new space when disk is resized OR new devices that were attached)
# Reference: http://blog.gurudelleccelsopicco.org/2009/09/online-lun-expansion-and-partition-resizing-without-reboot-under-linux/
echo 1 > /sys/block/[DEVICE]/device/rescan
# DETECT IF NEW DISKS ARE ATTACHED TO THE HOST
# Reference: http://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.html
ls /sys/class/scsi_host
@r4mp
r4mp / ESPWebForm.ino
Created November 16, 2017 02:40 — forked from bbx10/ESPWebForm.ino
Demonstrate using an http server and an HTML form to control an LED. The http server runs on the ESP8266.
/*
* Demonstrate using an http server and an HTML form to control an LED.
* The http server runs on the ESP8266.
*
* Connect to "http://esp8266WebForm.local" or "http://<IP address>"
* to bring up an HTML form to control the LED connected GPIO#0. This works
* for the Adafruit ESP8266 HUZZAH but the LED may be on a different pin on
* other breakout boards.
*
* Imperatives to turn the LED on/off using a non-browser http client.
@r4mp
r4mp / .zshrc
Last active April 1, 2016 08:18
twitch without flash on i3wm
[...]
function twitch() {
i3-msg "workspace 11:twitch; append_layout /home/$USER/.i3/workspace-twitch.json"
chromium --app="https://www.twitch.tv/${1}/chat?popout=" &
mpv https://www.twitch.tv/$1
}
[...]