Skip to content

Instantly share code, notes, and snippets.

Avatar
🙏
Don't think, feeeeeeeeeeeeel

PJ p3nj

🙏
Don't think, feeeeeeeeeeeeel
View GitHub Profile
@p3nj
p3nj / mediaplayer.py
Created March 2, 2023 22:58
monitor multiple players via playerctl with python script modified version
View mediaplayer.py
#!/usr/bin/env python3
import argparse
import logging
import sys
import signal
import gi
import json
gi.require_version('Playerctl', '2.0')
from gi.repository import Playerctl, GLib
View 20-hhkb-events.rules
# When HHKB is connected
ACTION=="add", SUBSYSTEM=="usb", ENV{XAUTHORITY}="/home/user/.Xauthority", ENV{DISPLAY}=":0", ATTRS{idVendor}=="0853", ATTRS{idProduct}=="0100", RUN+="/home/user/bin/hhkb add"
# When HHKB is disconnected.
ACTION=="remove", SUBSYSTEM=="usb", ENV{XAUTHORITY}="/home/user/.Xauthority", ENV{DISPLAY}=":0", ATTRS{idVendor}=="0853", ATTRS{idProduct}=="0100", RUN+="/home/user/bin/hhkb remove"
@p3nj
p3nj / terminal_benchmark.sh
Created November 16, 2019 14:55
A little script to test terminal's performance.
View terminal_benchmark.sh
#!/usr/bin/env bash
# Generate 100MB of random tex.
cat /dev/urandom | base64 | dd of=/tmp/randomdata bs=1024 count=100k
# Test. Repeat for each terminal...
# Results are written to bench_XXX.txt
# This also shows MB/s very nicely thanks to `dd`.
{ time dd if=/tmp/randomdata bs=10240; } 2> bench_XXX.txt
View Keybase.md

Keybase proof

I hereby claim:

  • I am limeless on github.
  • I am benjidude (https://keybase.io/benjidude) on keybase.
  • I have a public key ASAZWYpm8Nn6kYy0A9Jap0K8UyaxX0oc5zglufqZ9QORcwo

To claim this, I am signing this object:

@p3nj
p3nj / .chunkwmrc
Last active January 17, 2019 20:14
chunkwmrc
View .chunkwmrc
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
#
@p3nj
p3nj / mullvad-wg-ks.sh
Last active February 18, 2021 16:59
Mullvad VPN Wireguard script with killswitch implant.
View mullvad-wg-ks.sh
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2016-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
# Killswitch : https://github.com/vpn-kill-switch/homebrew-killswitch
die() {
echo "[-] Error: $1" >&2
exit 1
}
@p3nj
p3nj / mullvad-wg-pfctl-ks.sh
Last active September 8, 2021 09:13
Mullvad-WireGuard Script with macOS pfctl killswitch implant
View mullvad-wg-pfctl-ks.sh
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2016-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
die() {
echo "[-] Error: $1" >&2
exit 1
}
# Change this to your condition.
WIFI="en0"
View keybase.md

Keybase proof

I hereby claim:

  • I am limeless on github.
  • I am l1m3 (https://keybase.io/l1m3) on keybase.
  • I have a public key ASC5U-rMXb5O9kcEE__AmUoWKpvSp2CHYYXGVgKksiQDdQo

To claim this, I am signing this object:

@p3nj
p3nj / main.py
Created August 10, 2018 08:11
[加分題] 動物星球
View main.py
'''
猴子 2 樹上
蛇 2 地上
烏龜 4 水裡
熊 1 樹上
猴子 1 地上
蛇 3 樹上
猴子 3 樹上
OUTPUT:
@p3nj
p3nj / main.py
Created August 6, 2018 16:20
歌詞歌詞詞頻統計
View main.py
lyrics = []
while True:
i = input()
if i == '===':
break
i = i.split()
for j in i:
j = j.lower()
if j == "we're":
lyrics.append('we')