Skip to content

Instantly share code, notes, and snippets.

View tonejito's full-sized avatar
🐰
= ^ . ^ =

Andres Hernandez tonejito

🐰
= ^ . ^ =
View GitHub Profile
@tonejito
tonejito / Makefile
Created January 17, 2019 18:04
Download and install Noto Emoji font in Debian GNU/Linux with Gnome Desktop
SHELL=/bin/bash
DOWNLOADS=~/Downloads
NOTO_URL=https://noto-website-2.storage.googleapis.com/pkgs/Noto-hinted.zip
NOTO_ZIP=noto-font.zip
NOTO_DIR=/usr/share/fonts/opentype/noto
all: download install
download:
@tonejito
tonejito / install.sh
Last active October 19, 2018 22:50
ipcheck wrapper for HE.net Dynamic DNS service
#!/bin/bash
install --mode 0751 --owner root --group root ipcheck.py /usr/local/sbin/ipcheck.py
install --mode 0751 --owner root --group root ipcheck-wrapper /usr/local/sbin/ipcheck-wrapper
install --mode 0644 --owner root --group root ipcheck-cron.d /etc/cron.d/ipcheck
@tonejito
tonejito / php5.6-debian9-deploy.Makefile
Last active October 17, 2018 16:32
Install and configure @oerdnj php5.6-fpm on a @Debian 9 host
SHELL=/bin/bash
SURY_REPO=/etc/apt/sources.list.d/sury.list
.PHONY: deploy
deploy: repo install configure restart check
repo:
ifeq (,$(wildcard ${SURY_REPO}))
@tonejito
tonejito / 31-señales.c
Last active October 15, 2018 20:03
La mejor señal es SIGTERM, la mejor señal es SIGKILL.
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
void tangananica(int sig) {asm("nop;");}
void tanganana(int sig) {__asm__ ("nop;");}
int main(void)
{
printf("%s\n","La mejor señal es SIGTERM,");
@tonejito
tonejito / openssl.cnf
Created October 12, 2018 07:12
Generate SSL CSR and test CRT with wildcard CN and domain subjectAltName
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
@tonejito
tonejito / iptables-apache
Last active October 3, 2018 07:37
Check for spurious @apache httpd connections via iptables -j LOG
#!/bin/bash -vx
# = ^ . ^ =
# iptables-apache.sh
# Check for spurious @apache connections via iptables -j LOG
# Andres Hernandez - tonejito
# Released under the BSD 3-clause license
APACHE_USER=www-data
APACHE_UID=$(getent passwd ${APACHE_USER} | awk -F : '{print $3}')
APACHE_CHAIN=APACHE
@tonejito
tonejito / rails-backup
Last active September 29, 2018 01:29
@rails app and database backup scripts
#!/bin/bash
# Check the following URL for the
# Cache Directory Tagging Standard
# http://brynosaurus.com/cachedir/spec.html
DATE=$(date '+%Y%m%d-%H%M%S')
EXCLUDED_DIRS="rails/.git rails/vendor"
for DIR in ${EXCLUDED_DIRS}
@tonejito
tonejito / .bash_aliases
Last active September 26, 2018 15:34
Fix @apache httpd issues with SELinux on CentOS 7
# 0644 root:root ~/.bash_aliases
alias fix-apache-selinux='/usr/bin/sudo /usr/local/sbin/fix-apache-selinux'
@tonejito
tonejito / Makefile
Last active September 10, 2018 16:12
Makefile for OpenWRT configuration and build
# https://openwrt.org/docs/guide-developer/quickstart-build-images
SHELL=/bin/bash
DATE=$(shell date '+%s')
SRC_REPO=https://git.openwrt.org/openwrt/openwrt.git
SRC_DIR=openwrt
DEPS=\
subversion g++ zlib1g-dev build-essential git python rsync man-db \
libncurses5-dev gawk gettext unzip file libssl-dev wget zip time
@tonejito
tonejito / wp-comments-disable.sql
Created September 4, 2018 23:26
Disable comments and pingbacks on a @WordPress site
-- https://perishablepress.com/wordpress-discussion-management-enable-or-disable-comments-and-pingbacks-via-sql/
UPDATE posts SET comment_status = 'closed' , ping_status = 'closed' ;