Skip to content

Instantly share code, notes, and snippets.

Avatar

Attila Satan AttilaSATAN

View GitHub Profile
View gist:fe0c60a53e9cbf498ded081fac886702
const fs = require('fs');
const http = require('http');
const WebSocket = require('ws');
const child_process = require('child_process');
const WSPORT = 8082;
const CAM1URI = 'rtsp://78.186.127.222:554/11';
const CAM2URI = 'rtsp://78.186.127.222:555/11';
const CAM3URI = 'rtsp://78.186.127.222:556/11';
const ARGS = ['-rtsp_transport', 'tcp', '-i', 'rtsp://78.186.127.222:555/11', '-f',
'mpegts', '-codec:v', 'mpeg1video', '-s', '640x480', '-b:v', '1000k', '-bf', '0', '-'
@AttilaSATAN
AttilaSATAN / arch-linux-install
Created Mar 24, 2017 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
View arch-linux-install
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
View protractor-ile-end-to-end-test.md
View systemd-shutdown-debug.txt
Diagnosing Shutdown Problems
Just like with boot problems, when you encounter a hang during shutting down, make sure you wait at least 5 minutes to distinguish a permanent hang from a broken service that's just timing out. Then it's worth testing whether the system reacts to CTRL+ALT+DEL in any way.
If shutdown (whether it be to reboot or power-off) of your system gets stuck, first test if the kernel itself is able to reboot or power-off the machine forcedly using one of these commands:
sync && reboot -f
sync && poweroff -f
If either one of the commands does not work, it is a kernel bug, not systemd.
@AttilaSATAN
AttilaSATAN / site.com.nginx.conf
Created Oct 18, 2016
For redirecting every request to SSL and WWW. Using php-fpm.
View site.com.nginx.conf
server {
listen 80;
server_name site.com www.site.com;
return 301 https://www.site.com$request_uri;
}
server {
listen 443;
listen [::]:443;
@AttilaSATAN
AttilaSATAN / server.js
Created Nov 27, 2014
oi termination signals
View server.js
['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGTERM'].forEach(terminatorSetup);
View server.js
// // Website you wish to allow to connect
// res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3005');
//
// // Request methods you wish to allow
// res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, DELETE');
//
// // Request headers you wish to allow
// res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type,Authorization');
//
// // Set to true if you need the website to include cookies in the requests sent
@AttilaSATAN
AttilaSATAN / README.md
Created Nov 19, 2014
python version switch
View README.md

For me it got fixed by replacing python2.7 by python2.6. As per https://code.google.com/p/gyp/source/browse/trunk/DEPS#19 , it seems that gyp depends on python 2.6

On Ubuntu Saucy:

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.6
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
You can’t perform that action at this time.