Skip to content

Instantly share code, notes, and snippets.

View AttilaSATAN's full-sized avatar
🏠
Working from home

Attila Satan AttilaSATAN

🏠
Working from home
  • LTVPlus
  • Ankara, Turkey, Earth, Sol, Milkyway
View GitHub Profile
@AttilaSATAN
AttilaSATAN / server.js
Created November 27, 2014 09:05
oi termination signals
['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGTERM'].forEach(terminatorSetup);
https://trac.nginx.org/nginx/ticket/496#ticket
@AttilaSATAN
AttilaSATAN / site.com.nginx.conf
Created October 18, 2016 09:46
For redirecting every request to SSL and WWW. Using php-fpm.
server {
listen 80;
server_name site.com www.site.com;
return 301 https://www.site.com$request_uri;
}
server {
listen 443;
listen [::]:443;
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 / arch-linux-install
Created March 24, 2017 15:30 — 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
# 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
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', '-'