This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NEEDS TO BE RUN AS ADMIN | |
# If ran as a powershell script, you will need to run this first: | |
# Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process | |
# [CONFIGURATION] | |
# Ensure WSL2 container is started and SSH is running | |
wsl sudo /etc/init.d/ssh start | |
# Ports to be forwarded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cat << EOF >> .bash_aliases | |
#Add this into your .bashrc | |
#if [ -f ~/.bash_aliases ]; then | |
# . ~/.bash_aliases | |
#fi | |
#Some aliases | |
if [ -x /usr/bin/dircolors ]; then | |
COLOR_SUPPORT='--color=auto ' | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processRow(row, fields, fieldSeparator) | |
{ | |
const | |
outRow = [], | |
keys = Array.isArray(row) | |
? Object.keys(row) | |
: (fields || Object.keys(row)); | |
for(let j = 0; j < keys.length; j++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DQUOTE=$(echo "\42") | |
SQUOTE=$(echo "\47") | |
COMMAND="mysql -u USER -pPASSWD -h HOST --default-character-set=utf8 \ | |
--database=DB --batch -e ${DQUOTE}SELECT * FROM SOMEWHERE${DQUOTE} | \ | |
sed ${SQUOTE}s/${DQUOTE}/${DQUOTE}${DQUOTE}/g;s/\t/${DQUOTE},${DQUOTE}/g;s/^/${DQUOTE}/;s/$/${DQUOTE}/;s/\n//g;s/\\n/\n/g${SQUOTE} \ | |
> ${VOLUME_OUTPUT_FILE}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -u[user] -p[password] -h[host] --database=[database] --batch -e "SQL QUERY FROM X" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > export.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### This script is intended to be used from inside a git repository (Say any folder where git status would not fail) | |
### It is intended to be stored on a path folder to be used directly as follows: | |
### $ gitc ['comment'] | |
### | |
### If comment is missing it will still prompt asking for a comment, if no input it would use the default_comment value '-.-' | |
default_comment='-.-' |