Skip to content

Instantly share code, notes, and snippets.

View 7rin0's full-sized avatar

SEVERINO, Luis 7rin0

  • Lyon, France
View GitHub Profile
@7rin0
7rin0 / a2dp.py
Created February 19, 2018 11:19 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@7rin0
7rin0 / default.conf
Created January 18, 2018 05:30
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@7rin0
7rin0 / curl-websocket.sh
Created August 30, 2017 14:24 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
<html>
<head>
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var accessToken = "<your agent's client access token>";
var baseUrl = "https://api.api.ai/v1/";
@7rin0
7rin0 / watch_ps_grep_stdout.sh
Created July 14, 2017 21:25
Watch ps grep results
watch -n 2 'ps aux | grep node'
@7rin0
7rin0 / unix_proccess_serial_killer.sh
Last active July 14, 2017 21:23
Unix Proccess Serial killer
# Just replace SEARCH_PROCESS_SCRIPT_NAME by the script you want to stop
# https://unix.stackexchange.com/a/50573
SEARCH_PROCESS_SCRIPT_NAME="php /var/www/application/bin/script.php"
for pid in $(ps -ef | grep $SEARCH_PROCESS_SCRIPT_NAME | awk '{print $2}'); do sudo kill -9 $pid; done
@7rin0
7rin0 / word_count_grep_cli.sh
Created May 30, 2017 09:50
Word count , grep, cli
# https://www.cyberciti.biz/faq/unix-linux-grep-word-count-command/
grep -o -w 'foo' bar.txt | wc -w
git status -- . ':!PATH'
@7rin0
7rin0 / gist:8c1c88a92216d13619c6b4a77f3643c9
Created May 26, 2017 17:22
git config merge.renameLimit 999999
git config merge.renameLimit 999999
git config --unset merge.renameLimit
@7rin0
7rin0 / split_join_sources.md
Created May 24, 2017 09:36
Split and Join sources into tar pieces

Scenario:

We have a compressed sql dump with a size of 10 Gb and we need to upload into free storage limited by 1Go each upload.

SOURCE:

dump.tar (or any other folder, tar, file, directory, etc)

TARGET:

dump_sql.tar. (will be suffixed by each part id)

SPLITTED FILE SIZE: