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
| # from /usr/sbin/ | |
| wget https://raw.githubusercontent.com/adafruit/Adafruit-Retrogame/master/retrogame | |
| chmod 755 retrogame | |
| # from /boot | |
| # original retrogame.cfg with full example file at: | |
| # https://raw.githubusercontent.com/adafruit/Adafruit-Retrogame/master/configs/retrogame.cfg.zero | |
| # | |
| wget wget https://gist.githubusercontent.com/dbonates/159a3d491a8d147facde651559b76620/raw/698f5e34a46d28fc018c96fd075318fc4f02745f/retrogame.cfg |
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 | |
| PIDFILE=/var/run/retrogame.pid | |
| NAME="S32retrogame" | |
| RUN_AS=root | |
| CMD=/usr/bin/retrogame | |
| do_start() { | |
| # "... Starting : retrogame gpio-remapper" | |
| start-stop-daemon --start --background --user $RUN_AS --pidfile $PIDFILE --make-pidfile --chuid $RUN_AS --startas $CMD | |
| } | |
| do_stop() { |
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
| LEFT 17 # Joypad left | |
| RIGHT 5 # Joypad right | |
| DOWN 27 # Joypad down | |
| UP 23 # Joypad up | |
| Z 4 # 'A' button | |
| X 20 # 'B' butto | |
| ESC 6 # Exit ROM; PiTFT Button 1 | |
| LEFTCTRL 26 # 'Select' button; PiTFT Button 2 |
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
| SELECT datname, pg_size_pretty(pg_database_size(datname)) | |
| FROM pg_database; | |
| --Tamanho de todas as tabelas. | |
| SELECT relname as "Table", | |
| pg_size_pretty(pg_total_relation_size(relid)) As "Size", | |
| pg_size_pretty(pg_total_relation_size(relid) - | |
| pg_relation_size(relid)) as "External Size" | |
| FROM pg_catalog.pg_stat_all_tables ORDER BY | |
| pg_total_relation_size(relid) DESC; |
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
| { | |
| "Code": 1, | |
| "Message": "Success", | |
| "Result": { | |
| "PurchaseListTotalSize": 156, | |
| "PurchaseList": [ | |
| { | |
| "PurchaseID": 69154851, | |
| "ExpirationDate": "\/Date(1564542000000)\/", | |
| "PurchaseStatus": "Canceled", |
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
| sudo add-apt-repository -y ppa:pi-rho/dev | |
| sudo apt-get update -yqqu | |
| sudo apt-get install tmux-next | |
| sudo rm /usr/bin/tmux | |
| sudo ln -s /usr/bin/tmux-next /usr/bin/tmux |
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
| for i in {0..255}; do printf "\x1b[38;5;${i}mcolour%-5i\x1b[0m" $i ; if ! (( ($i + 1 ) % 8 )); then echo ; fi ; done | |
| # ex: choose your color than execute: | |
| # set -g status-fg colour28 |
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
| # this command will search and replace all occurrences of string1 to string2 | |
| ack -l string1 | xargs perl -pi -E 's/string1/string2/g' | |
| # as function to make life easier | |
| # | |
| # usage: replace oldString newString | |
| # | |
| func replace() { | |
| ack -l "$1" | xargs perl -pi -E "s/${1}/${2}/g" | |
| } |
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 file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh | |
| # | |
| # This file echoes a bunch of 24-bit color codes | |
| # to the terminal to demonstrate its functionality. | |
| # The foreground escape sequence is ^[38;2;<r>;<g>;<b>m | |
| # The background escape sequence is ^[48;2;<r>;<g>;<b>m | |
| # <r> <g> <b> range from 0 to 255 inclusive. | |
| # The escape sequence ^[0m returns output to default |
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
| #!/usr/bin/env bash | |
| sudo apt update | |
| #sudo apt install -y git | |
| sudo apt install -y automake | |
| sudo apt install -y build-essential | |
| sudo apt install -y pkg-config | |
| sudo apt install -y libevent-dev | |
| sudo apt install -y libncurses5-dev | |
| rm -fr /tmp/tmux | |
| git clone https://github.com/tmux/tmux.git /tmp/tmux |