Skip to content

Instantly share code, notes, and snippets.

View KiLLeRRaT's full-sized avatar

Albert Gouws KiLLeRRaT

View GitHub Profile
@mauron85
mauron85 / README.md
Last active May 24, 2024 13:46 — forked from maxfierke/README.md
PM2 as a Windows Service under Local Service

PM2 as a Windows Service under Local Service

This is a PoC for running PM2 as a Windows Service under the Local Service account instead of the Local System account.

Prerequsites

  • Neither pm2 or pm2-windows-service installed yet. (The Powershell script will run npm i)
    • At the very least, you should run pm2-service-uninstall before running this script
  • npm and npm-cache global folders should be somewhere accessible to NT AUTHORITY\LocalService.
@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active June 12, 2024 16:31
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
@samoshkin
samoshkin / toggle_keybindings.tmux.conf
Last active June 8, 2024 23:04
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
@mort3za
mort3za / git-auto-sign-commits.sh
Last active May 28, 2024 20:51
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@michaelfox
michaelfox / form-restore.bm.js
Created May 22, 2014 18:27
Form Save / Restore Bookmarklets
javascript:(function(e%2Ct%2Ci%2Co%2Cn%2Ca%2Cr%2Cc)%7Bif(!(n%3De.jQuery)%7C%7Ci%3En.fn.jquery%7C%7Co(n))%7Ba%3Dt.createElement(%22script%22)%3Ba.type%3D%22text%2Fjavascript%22%3Ba.src%3D%22http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F%22%2Bi%2B%22%2Fjquery.min.js%22%3Ba.onload%3Da.onreadystatechange%3Dfunction()%7Bif(!r%26%26(!(c%3Dthis.readyState)%7C%7C%22loaded%22%3D%3D%3Dc%7C%7C%22complete%22%3D%3D%3Dc))%7Bo((n%3De.jQuery).noConflict(1)%2Cr%3D1)%3Bn(a).remove()%7D%7D%3Bt.documentElement.childNodes%5B0%5D.appendChild(a)%7D%7D)(window%2Cdocument%2C%221.11.0%22%2Cfunction(e)%7Bfunction%20t(t)%7Bvar%20i%3De(t)%2Co%3D%5B%22id%22%2C%22name%22%2C%22action%22%5D%2Cn%3Dfalse%3Be.each(o%2Cfunction(e%2Ct)%7Bif(!n%26%26i.attr(t))n%3Di.attr(t)%7D)%3Breturn%20n%7De.unserialize%3Dfunction(e)%7Bfor(var%20t%2Ci%2Co%3DdecodeURI(e.replace(%2F%5C%2B%2Fg%2C%22%20%22))%2Cn%3Do.split(%22%26%22)%2Ca%3D%7B%7D%2Cr%3D0%2Cc%3Dn.length%3Br%3Cc%3Br%2B%2B)%7Bt%3Dn%5Br%5D.split(%22%3D%22)%3Bi%3Dt%5B0%5D%3Bif(void%200%3D%3D%3
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 22, 2024 09:39
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k