Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Martín Roldán Araujo ratacibernetica

🎯
Focusing
Block or report user

Report or block ratacibernetica

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ratacibernetica
ratacibernetica / speedtest.sh
Created Nov 29, 2019
speedtest from command line with bash
View speedtest.sh
#! /bin/bash
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
View vimrc
syntax on
filetype plugin indent on
set swapfile
set dir=/tmp
set nu
set expandtab ts=4 sw=4 ai
let mapleader=","
imap ,w <ESC>:w<CR>
imap jj <ESC>
nnoremap <Leader>w :w<CR>
@ratacibernetica
ratacibernetica / pw.sh
Created Oct 23, 2019
phpunit run automatically with inotifywait (linux)
View pw.sh
#!/bin/bash
while true; do
FILE=$(inotifywait tests/*/*.php --format="%w%f" ) &&
clear &&
vendor/bin/phpunit --color $FILE
done
@ratacibernetica
ratacibernetica / pw.sh
Created Oct 23, 2019
run phpunit automatically with watchman
View pw.sh
watchman-make -p 'app/**/*.php' 'tests/**/*.php' --make=vendor/bin/phpunit -t tests
@ratacibernetica
ratacibernetica / autossh-vnc-tunnel.service
Created Aug 29, 2019
autossh reverse ssh tunnel vnc on boot using systemd
View autossh-vnc-tunnel.service
#file: /etc/systemd/system/autossh-vnc-tunnel.service
[Unit]
Description=AutoSSH tunnel service everything
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -N -o "ExitOnForwardFailure=yes" -o "PubkeyAuthentication=yes" -o "StrictHostKeyChecking=false" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 5903:localhost:5901 -i /home/pi/.ssh/id_rsa user@server -p1234
[Install]
View ssh-as-www-data.sh
# this-account-is-currently-not-available-error-when-trying-to-ssh
su -l www-data -s /bin/bash
View filter_array.php
<?php
/**
* Removes unwanted key|values from array.
* @param array $filters
* @return array
*/
function applyFilters(array $request){
$allowedFields = ['field_1','field_2','field_3','field_4'];
$filters = array_intersect_key($request, array_flip($allowedFields));
return $filters;
@ratacibernetica
ratacibernetica / slow_query_log_on.sql
Last active Jun 7, 2019
mysql enable slow query log
View slow_query_log_on.sql
SHOW VARIABLES LIKE '%log%';
SET GLOBAL general_log = 'ON';
SET GLOBAL slow_query_log = 'ON';
-- set global slow_query_log_file = 'path';
@ratacibernetica
ratacibernetica / EnsureQueueListenerIsRunning.php
Last active May 28, 2019 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
View EnsureQueueListenerIsRunning.php
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
View oculus-stream-to-mac.sh
adb exec-out "while true; do screenrecord --bit-rate=8m --output-format=h264 --time-limit 180 -; done" | ffplay -framerate 60 -framedrop -bufsize 16M -
You can’t perform that action at this time.