Skip to content

Instantly share code, notes, and snippets.

@lexuzieel
lexuzieel / parse-options.sh
Created August 29, 2016 02:18 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@lexuzieel
lexuzieel / putty-monokai.reg
Created October 13, 2016 17:57 — forked from gdvalle/putty-monokai.reg
Monokai style theme for PuTTY; colors copied from ST2's theme
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"
@lexuzieel
lexuzieel / perfectelementary.bash
Created March 26, 2017 17:49
Things to install on a fresh installation of ElementaryOS
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
#Install gedit (Text Editor)
@lexuzieel
lexuzieel / instructions.md
Last active April 6, 2017 22:07 — forked from tobias-kuendig/instructions.md
Elementary OS redshift-gtk Indicator Icons
  1. Copy redshift-status-off.svg and redshift-status-on.svg to /usr/share/icons/hicolor/scalable/apps/
  2. Restart redshift-gtk

Or run the following commands:

wget https://gist.githubusercontent.com/lexuzieel/c6840190b61761e4cbdbfcea866a0f4a/raw/1d4d4895f8b4395c39a5482a7b9d4a229cb32582/redshift-status-off.svg -O /tmp/redshift-status-off.svg
wget https://gist.githubusercontent.com/lexuzieel/c6840190b61761e4cbdbfcea866a0f4a/raw/1d4d4895f8b4395c39a5482a7b9d4a229cb32582/redshift-status-on.svg -O /tmp/redshift-status-on.svg
@lexuzieel
lexuzieel / Install-php7.md
Last active April 27, 2017 15:25 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@lexuzieel
lexuzieel / crontab -e
Created June 13, 2017 19:49
Scheduled git push
0 0 * * * app/git-content-push.sh
@lexuzieel
lexuzieel / BigEndianBinaryReader.cs
Created February 20, 2018 21:53
Simple implementation of a big-endian BinaryReader in C#.
using System;
using System.IO;
using System.Text;
namespace ProjectZomboidThing
{
class BigEndianBinaryReader : BinaryReader
{
public BigEndianBinaryReader(Stream input) : base(input)
{
@lexuzieel
lexuzieel / .aliases
Created July 2, 2018 17:50
Shell aliases
# Git
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold white)<%an>%Creset' --abbrev-commit"
alias gs="git status"
alias ga="git add "
alias gaa="git add ."
alias gc="git commit -m "
alias gcom="git checkout master"
alias gco="git checkout"
# Composer
ffmpeg -i 11061145_0005.MP4 -c:a copy -c:v libx264 -crf 30 -vf scale=1920:-2:flags=lanczos -preset ultrafast 1080_11061145_0005.MP4

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .ini file. In this example, laravel_queue.ini (contents below). Give it execute permissions: chmod +x laravel_queue.ini.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.