Skip to content

Instantly share code, notes, and snippets.

@rootlocal
rootlocal / create_php_site.sh
Created November 26, 2017 20:43 — forked from jun9/create_php_site.sh
Nginx and PHP-FPM, bash script for creating new vhost’s under separate fpm pools
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 17/05/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
@rootlocal
rootlocal / pgsql_fts_migration.php
Created December 31, 2017 05:23 — forked from Insolita/pgsql_fts_migration.php
Полнотекстовый поиск postgres+yii2 - миграция
<?php
use yii\db\Migration;
class m170105_004305_add_fts extends Migration
{
public function safeUp()
{
/*
@rootlocal
rootlocal / pgsql_fts_migration.php
Created December 31, 2017 05:23 — forked from Insolita/pgsql_fts_migration.php
Полнотекстовый поиск postgres+yii2 - миграция
<?php
use yii\db\Migration;
class m170105_004305_add_fts extends Migration
{
public function safeUp()
{
/*
@rootlocal
rootlocal / puma.monitrc
Created February 5, 2018 09:44 — forked from sudara/puma.monitrc
Example config needed to use monit with puma, monitoring workers for mem.
# this monit config goes in /etc/monit/conf.d
check process puma_master
with pidfile /data/myapp/current/tmp/puma.pid
start program = "/etc/monit/scripts/puma start"
stop program = "/etc/monit/scripts/puma stop"
group myapp
check process puma_worker_0
with pidfile /data/myapp/current/tmp/puma_worker_0.pid
@rootlocal
rootlocal / x11_docker_mac.md
Created August 23, 2018 11:38 — forked from cschiewek/x11_docker_mac.md
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@rootlocal
rootlocal / samson-infomat.sh
Last active April 13, 2019 19:32
скрипт запуска
#!/usr/bin/env sh
### BEGIN INIT INFO
# Provides: samson-infomat
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start samson infomat daemon
# Description: Start samson infomat daemon
### END INIT INFO
#!/usr/bin/env python2.7
import ldap
ldapDomain = 'ldap://ads00'
ldapUser = 'USERNAME'
ldapPass = 'PASSWORD'
ldapDN = 'OU=Groups,DC=domain,DC=local'
groupName = 'TS_TERM04_USERS'
@rootlocal
rootlocal / TaskBasedSplash.java
Created May 15, 2019 19:59 — forked from jewelsea/TaskBasedSplash.java
Displays a JavaFX splash page for an intensive startup task with progress monitoring
import javafx.animation.FadeTransition;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.collections.*;
import javafx.concurrent.*;
import javafx.geometry.*;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.effect.DropShadow;
import javafx.scene.image.*;
@rootlocal
rootlocal / zabbix_agentd.conf
Created December 20, 2019 13:14 — forked from xandr0s/zabbix_agentd.conf
Config Zabbix-agent on OpenWRT router/AP
LogFile=/tmp/zabbix_agentd.log
Server=1.2.3.4
ServerActive=1.2.3.4
Hostname=Zabbix server
# wifi interface discovery
# exemple: {"data":[{"{#IF}":"wlan0", "{#MODE}":"ap", "{#SSID}":"Openwrt", "{#NET}":"lan", "{#DEV}":"radio0", "{#ENC}":"psk2+ccmp", "{#TYPE}":"mac80211", "{#HWMODE}":"11ng", "{#CHANNEL}":"11", "{#BSSID}":"xx:xx:xx:xx:xx:xx"}]}
#
UserParameter=wifi.ifdiscovery,lua -l uci -l iwinfo -e 'x = uci.cursor(nil, "/var/state");list = "{\"data\":[";x:foreach("wireless", "wifi-iface", function(s) list=list.."{\"{#IF}\":\""..s.ifname.."\", \"{#MODE}\":\""..s.mode.."\", \"{#SSID}\":\""..s.ssid.."\", \"{#NET}\":\""..s.network.."\", \"{#DEV}\":\""..s.device.."\", \"{#ENC}\":\""..(s.encryption or "?").."\", \"{#TYPE}\":\""..x:get("wireless",s.device,"type").."\", \"{#HWMODE}\":\""..(x:get("wireless",s.device,"hwmode") or "?").."\", \"{#CHANNEL}\":\""..x:get("wireless",s.device,"channel").."\", \"{#BSSID}\":\""..iwinfo[iwinfo.type(s.ifname)].bssid(s.ifname).."\"}," end); list=string.gsub(list,",$",""); print(li
@rootlocal
rootlocal / .jshintrc.js
Created April 27, 2020 12:36 — forked from connor/.jshintrc.js
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.