Skip to content

Instantly share code, notes, and snippets.

@ultreson
ultreson / firefox.bat
Created November 9, 2020 22:40
password protect the execution of firefox with a specific user account
@echo off
::start
::color 01
set input=
set /p input=Password:
cls
if %input%==other goto 1
if %input%==exit goto quit
@echo wrong password
goto start
@ultreson
ultreson / add-empty-dirs-to-git.sh
Created September 2, 2020 20:04
Add empty directories to the git repo by creating a .gitkeep file under them recursively
#!/bin/bash
# Source : https://bytefreaks.net/gnulinux/bash/how-to-add-automatically-all-empty-folders-in-git-repository
find $PATH_TO_REPOSITORY -type d ! -path "*.git*" -empty -exec touch '{}'/.gitkeep \;
@ultreson
ultreson / fix-code.sh
Last active September 2, 2020 19:46
runs phpcs and 2 fixers on given folder, tested on ubuntu WSL2 with php7.1
#!/bin/bash
# fix-code
# author : @ultreson
# Date created : August 2020
# argument 1 - directory to run the code sniffer on
# example: fixcode.sh ~/myPhpProject
# dependencies: phpcs, phpcbf, php-cs-fixer installed and included in PATH
@ultreson
ultreson / create_ssh
Created August 15, 2020 23:01 — forked from robkorv/create_ssh
generate ssh bash script
#!/bin/sh
# https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
# ./create_ssh me@example.com mygit <-- creates ~/.ssh/mygit_rsa.pub and ~/.ssh/mygit_rsa
if [ -n "$1" ]; then
COMMENT=$1
else
COMMENT=$USER
fi
@ultreson
ultreson / howto-forward-x11-to-win10-via-putty-git-bash-vcxsrv.md
Last active August 15, 2020 19:56 — forked from vietlq/howto-forward-x11-to-win10-via-putty-vcxsrv.md
Code2Pro: How to Forward X11 to Windows 10 via PuTTY / Git Bash & vcxsrv

Code2Pro: How to Forward X11 to Windows 10 via git bash & vcxsrv

Scope

Tested on Windows 10 & Ubuntu 16.

Steps

  1. Check that sshd on Ubuntu is properly configured