Skip to content

Instantly share code, notes, and snippets.

@ChieftainY2k
ChieftainY2k / userChrome.css
Last active February 6, 2019 14:00
Multi-row tabs for Firefox 65, save this file as "YOUR_FIREFOX_PROFILE_DIRECTORY\chrome\userChrome.css" , then restart firefox.
.tabbrowser-tab:not([pinned]) { flex-grow:1; min-width:150px; }
.tabbrowser-tab,.tab-background { height:35px; }
.tab-stack { width: 100%; }
#tabbrowser-tabs .scrollbox-innerbox { display: flex; flex-wrap: wrap; }
#tabbrowser-tabs .arrowscrollbox-scrollbox { overflow: visible; display: block; }
#main-window[sizemode=“maximized”] #TabsToolbar{ margin-left:var(–tab-min-height); }
#tabbrowser-tabs .scrollbutton-up,#tabbrowser-tabs .scrollbutton-down,#alltabs-button,.tabbrowser-tab:not([fadein]){ display: none; }
@ChieftainY2k
ChieftainY2k / raspberry_DS18B20_logger.sh
Last active November 13, 2019 09:58
RaspberryPi: Bash one-liner to read and log raw data from DS18B20 sensors into a file (every 10 seconts)
watch -n 10 "TIME=\$(date '+%Y-%m-%d %H:%M:%S'); READING=\$(cat /sys/bus/w1/devices/28*/w1_slave); echo \"\$TIME\\n\$READING\" | tee -a /var/tmp/thermo.log"
@ChieftainY2k
ChieftainY2k / create_image.sh
Last active November 4, 2020 10:06
Raspberry PI: Create system partition image to an external drive
#!/bin/bash
# Example: ./create_image.sh /mnt/raspios-$(date "+%Y%m%d").img
#helper function
log_message()
{
LOGPREFIX="[$(date '+%Y-%m-%d %H:%M:%S')][$(basename $0)]"
MESSAGE=$1
echo "$LOGPREFIX $MESSAGE"
@ChieftainY2k
ChieftainY2k / gist:57fb72acb413391d8b6b7f74ef55ac18
Created July 26, 2021 07:44
Xdebug XDEBUG_TRIGGER bookmarklet on/off switch
javascript: { (function () { document.cookie = "XDEBUG_TRIGGER=1" + "" + ";expires=Mon, 05 Jul 2099 00:00:00 GMT;path=/;Samesite=strict"; })(); console.log("Xdebug turned on"); };
----
javascript: { (function () { document.cookie = "XDEBUG_TRIGGER=0" + "" + ";expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;Samesite=strict"; })(); console.log("Xdebug turned off"); };
@ChieftainY2k
ChieftainY2k / gist:1327daf4c1cbac21d45d0446a0ed743b
Last active February 22, 2022 07:14
Windows directory premissions fix , use it when your ACL is messed up by cygwin
takeown /f D:\website\mysite /r /d y
icacls D:\website\mysite /reset /t /c /l
@ChieftainY2k
ChieftainY2k / gist:b410b2ac7b20d062b0930018feeedcf1
Created August 19, 2021 11:09
Windows Cygwin file permission fix
takeown /f D:\website\mysite /r /d y
icacls D:\website\mysite /reset /t /c /l
@ChieftainY2k
ChieftainY2k / my-screen.sh
Last active June 19, 2024 08:04
My private screen session for shared shell environments
#!/bin/bash
set -e
NAMESPACE=${NAMESPACE:-default}
echo "************************************************************************************************************"
echo "This screen session is for namespace \"${NAMESPACE}\" "
echo "If you are not the owner of this namespace please exit now (Ctrl-C) , thanks :)"
echo "If you want to use your own screen namespace, use: NAMESPACE=youname $0"
export DOCKER_BUILDKIT=1
export LESSCHARSET=utf-8
export HISTCONTROL=ignoredups:erasedups
shopt -s histappend
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
export PS1='$(whoami)@$(hostname):$(pwd) #'
@ChieftainY2k
ChieftainY2k / gist:88bdc9c7c38a8da97acba69e60953624
Last active April 19, 2023 19:24
Filters to filter out shorts in the youtube subscruption feed
[Adblock Plus 2.0]
! Version: 1.0
! Title: Block shorts in youtube subscription feed
! Expires: 30 days
!
! GLOBAL RULES
!
www.youtube.com##ytd-guide-renderer a.yt-simple-endpoint path[d^="M10 14.65v-5.3L15 12l-5 2.65zm7.77-4.33"]:upward(ytd-guide-entry-renderer)
www.youtube.com##ytd-mini-guide-renderer a.yt-simple-endpoint path[d^="M10 14.65v-5.3L15 12l-5 2.65zm7.77-4.33"]:upward(ytd-mini-guide-entry-renderer)
www.youtube.com##ytd-browse #dismissible ytd-rich-grid-slim-media[is-short]:upward(ytd-rich-section-renderer)
@ChieftainY2k
ChieftainY2k / unzip
Created May 10, 2023 09:56
Vagrant unzip wrapper
#!/bin/sh
#copy this file to /usr/local/bin/unzip
/usr/bin/unzip "$@"
sleep 0.2