Skip to content

Instantly share code, notes, and snippets.

View themegabyte's full-sized avatar

Shayan themegabyte

View GitHub Profile
# Set vi key bindings mode
set -g mode-keys vi
set -g status-keys vi
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# List of plugins
@mattbell87
mattbell87 / remote-wsl.md
Last active July 23, 2024 05:11
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Proxy jump method

  1. On the host set up OpenSSH for Windows
  2. Run wsl --update to make sure you are running the latest WSL
  3. Open WSL and install another SSH server inside WSL with sudo apt-get install openssh-server
  4. Now run sudo systemctl enable --now ssh to automatically start ssh when WSL starts.
@kasuken
kasuken / VS 2019 and VS Code - Defender Exclusions.ps1
Last active February 12, 2024 03:30
This script adds path exclusions to Windows Defender for VS 2019 and Visual Studio Code processes and folders.
# Remember to run the script "as Administrator"
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($env:USERPROFILE + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add($env:USERPROFILE + '\.nuget\packages') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
@karbassi
karbassi / README.md
Last active July 20, 2024 13:19
Archive all messages in Google Messages web app

Archive all messages in Google Messages web app

This code was something I quickly put together to archive over 5000 text messages in Google Messages. I have no idea if Google frowns on this or not, but it's basically the same as if a human sat there and archived all the messages by hand.

Tested and working as of Monday, November 4, 2019.

How to run

  1. Sign into https://messages.google.com/web/
  2. Open Chrome Developers console by going to View > Developer > JavaScript Console.
  3. Copy and paste the code below into console. It should automatically run.
@JamoCA
JamoCA / NordVPN-Server-IP-List.txt
Last active July 8, 2024 18:32
NordVPN Server IP List; 2,590 IPs; 2020-02-04T15:31:55Z
103.120.66.35
103.120.66.51
103.227.255.101
103.60.9.27
103.60.9.75
103.62.49.193
103.62.49.195
103.62.49.198
103.62.49.203
103.62.49.205
@giautm
giautm / build-id.js
Created June 14, 2018 08:09
Next.JS Build-ID with last git commit
const fs = require('fs')
const path = require('path')
const { execFile } = require('child_process')
function lastCommitId(dir) {
return new Promise((resolve, reject) => {
const gitArgs = [
`--git-dir=${path.join(dir, '.git')}`,
`--work-tree=${dir}`,
'rev-parse',
@noelbundick
noelbundick / LICENSE
Last active May 24, 2024 09:10
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@galexrt
galexrt / node_exporter.sh
Last active February 26, 2024 20:33
Simple Prometheus node_exporter install script (Updated for 1.0.1)
#!/bin/bash
version="${VERSION:-1.0.1}"
arch="${ARCH:-linux-amd64}"
bin_dir="${BIN_DIR:-/usr/local/bin}"
wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \
-O /tmp/node_exporter.tar.gz
mkdir -p /tmp/node_exporter
@efrecon
efrecon / run.tpl
Last active July 23, 2024 20:03
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
# ~/.bashrc: executed by bash(1) for non-login shells.
# .see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If running non interactively, do nothing
########################################################
#|# Preamble #
########################################################
[ -z "$PS1" ] && return