Skip to content

Instantly share code, notes, and snippets.

View mikepsinn's full-sized avatar
💭
Attaining universal consciousness

Mike P. Sinn mikepsinn

💭
Attaining universal consciousness
View GitHub Profile
PHP 17 hrs 58 mins ██████████▍░░░░░░░░░░ 49.5%
JavaScript 6 hrs 6 mins ███▌░░░░░░░░░░░░░░░░░ 16.8%
Other 3 hrs 26 mins █▉░░░░░░░░░░░░░░░░░░░ 9.5%
YAML 2 hrs 7 mins █▏░░░░░░░░░░░░░░░░░░░ 5.8%
HTML 1 hr 36 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.5%
@mikepsinn
mikepsinn / did:3:kjzl6cwe1jw1487172o2ukeg5fx3jrc9mt0w9lwjk4hnx2jlznyk3w5gy5zu6k8
Created April 28, 2022 02:32
did:3:kjzl6cwe1jw1487172o2ukeg5fx3jrc9mt0w9lwjk4hnx2jlznyk3w5gy5zu6k8
did:3:kjzl6cwe1jw1487172o2ukeg5fx3jrc9mt0w9lwjk4hnx2jlznyk3w5gy5zu6k8
@mikepsinn
mikepsinn / install-choco-script.bat
Last active August 6, 2021 19:20 — forked from zaccb/install-choco-script.bat
Chocolatey install script
:: Install choco .exe and add choco to PATH
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install all the packages
:::: Browsers
choco install googlechrome -fy
choco install firefox -fy
:::: Text editors / IDEs
choco install atom -fy
@mikepsinn
mikepsinn / Jenkinsfile
Created July 21, 2021 18:32 — forked from stormisOld/Jenkinsfile
Jenkinsfile for php static analysis using docker
#!/usr/bin/env groovy
properties([
pipelineTriggers([
triggers: [
[
$class: 'com.cloudbees.jenkins.plugins.BitBucketTrigger',
]
]
]),
@mikepsinn
mikepsinn / no-root.sh
Created July 3, 2021 03:38
die if root
#!/bin/bash
if [[ $EUID -eq 0 ]]; then
echo
echo "================ Error ================="
echo "Do not run this as the root user"
echo "========================================"
echo
exit 1
fi
@mikepsinn
mikepsinn / wait_for_200_response.sh
Last active November 29, 2018 00:25
Checks a url every 30 seconds and sleeps until 200 response
#!/usr/bin/env bash
# You can run from a gist using:
# curl https://gist.githubusercontent.com/mikepsinn/5556d7dc21a255118e53cd59c2037ef1/raw/50276f283f9ac5e6b5b383ce2089090a6f6d119c/wait_for_200_response.sh | bash -s URL_HERE
set -x
until $(curl --output /dev/null --silent --head --fail ${1}); do
echo "Waiting for ${1}"
sleep 30
done
echo "200 from ${1}"
@mikepsinn
mikepsinn / wait_for_200_response.sh
Created November 29, 2018 00:12
Checks a url every 30 seconds and sleeps until 200 response
#!/usr/bin/env bash
set +x
url=${1:-${url}}
#url=https://qm-staging.quantimo.do/ionic/Modo/www/scripts/combined-head-libraries-6fcc81560c.js
echo "CHECKING $url"
timeout=${2:-'3'}
# ^in seconds
flag=${3:-'--status'}
# curl options, e.g. -L to follow redirects
@mikepsinn
mikepsinn / mysql2sqlite.sh
Last active April 29, 2018 02:56 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# curl https://gist.githubusercontent.com/mikepsinn/2bd31d9c8c397c8af895e8c833ea5f32/raw/mysql2sqlite.sh | bash -s --no-data -u root -pMySecretPassWord quantimodo_test | sqlite3 database.sqlite
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
#!/bin/bash
echo "You can run from a gist using:"
echo "curl https://gist.github.com/mikepsinn/c556646c70c4a3ec71c5b057eeab75e6/raw/147dc4386f8cc0c6a47e450997f4821e07845ceb/mysql_create_user.sh | bash -s ROOT_PASSWORD NEW_USER_PASSWORD"
if [ ! -f ~/.my.cnf ];
then
echo "ERROR: Please create ~/.my.cnf containing:"
echo "[client]"
echo "password=your_pass"
exit 1
else
Package the pre-configured box =>
vagrant package --base preconfigured_vm --output /path/to/qm-ubuntu-slave-vagrant-package.box
i.e. vagrant package --base QM-Docker_default_1515955669346_6871 --output K:\Development\qm-ubuntu-slave-vagrant-package.box
Note that as per the docs, the --base option should be the UUID of the machine,
or the name VirtualBox gives the machine (found when opening the VirtualBox application).
Transfer the box to the computer by using scp, rsync or whatever...
(you also start a web server quickly by using python -m http.server PORT or ruby -run -e httpd /path/to -p PORT)