Skip to content

Instantly share code, notes, and snippets.

View DeviaVir's full-sized avatar
🏴‍☠️

Chase DeviaVir

🏴‍☠️
View GitHub Profile
@DeviaVir
DeviaVir / lessneglect.lib.php
Created September 11, 2012 22:30
A PHP library for the lessneglect.com API
<?PHP
Class LN {
// API credentials
private static $api_key = '';
private static $api_secret = '';
// Production (no sandboxed version available yet)
private static $api_url = 'https://lessneglect.com/api/v2/';
// Show debug messages?
@DeviaVir
DeviaVir / redis-sentinel
Last active February 13, 2019 20:06
An init.d script for redis sentinel, to have it run as a daemon instead of in a screen. (Tested on CentOS 6)
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
#!/usr/bin/perl -w
# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn).
#
# See:
# runtime/queue.c: qqueuePersist()
# runtime/queue.c: qqueueTryLoadPersistedInfo()
#
# kaiwang.chen@gmail.com 2012-03-14
#
use strict;
@DeviaVir
DeviaVir / countries.sql
Created September 24, 2012 12:46
All countries and their currencies
#
# http://peric.github.com/GetCountries/
#
CREATE TABLE IF NOT EXISTS `countries` (
`idCountry` int(5) NOT NULL AUTO_INCREMENT,
`countryCode` char(2) NOT NULL DEFAULT '',
`countryName` varchar(80) NOT NULL DEFAULT '',
`currencyCode` char(3) DEFAULT NULL,
PRIMARY KEY (`idCountry`)
@DeviaVir
DeviaVir / mysql-cluster.service
Created March 7, 2017 09:23
MySQL Cluster systemd service
[Unit]
Description=MySQL Cluster server
After=network.target auditd.service
[Service]
ExecStart=/opt/mysql/server-5.7/bin/ndb_mgmd -f /var/lib/mysql-cluster/config.ini
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
import time
def main():
SLEEP_DELAY = 10
for i in xrange(100):
print("Hello world! The time is now: %s. Sleeping for %d secs" % (
time.asctime(), SLEEP_DELAY))
time.sleep(SLEEP_DELAY)
if __name__ == "__main__":
@DeviaVir
DeviaVir / coredumpctl.gdb
Created July 4, 2018 09:03
q-desktop core dump
$ coredumpctl gdb 7884
PID: 7884 (q-desktop)
UID: 1000 (chase)
GID: 985 (users)
Signal: 5 (TRAP)
Timestamp: Wed 2018-07-04 10:58:14 CEST (1min 39s ago)
Command Line: /usr/bin/q-desktop
Executable: /usr/bin/q-desktop
Control Group: /user.slice/user-1000.slice/session-c1.scope
Unit: session-c1.scope
#!/bin/bash
. "${0%/*}/../common.sh"
declare -A default
while IFS== read key value; do
default["$key"]="$value"
done < /etc/hardening-wrapper.conf
force_fPIE="${HARDENING_PIE:-"${default[HARDENING_PIE]:-1}"}"
abs
adobe-source-han-sans-cn-fonts
aic94xx-firmware
alsa-utils
anamnesis
android-tools
ansible
arch-install-scripts
archon
archon-exec
@DeviaVir
DeviaVir / php-fpm
Created October 16, 2013 10:22
CENTOS /etc/init.d/php-fpm Don't forget to chmod +x /etc/init.d/php-fpm to make it executable
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fpm
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php-fpm
# Description: starts the PHP FastCGI Process Manager daemon