Skip to content

Instantly share code, notes, and snippets.

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

Andrés Aquino andresaquino

🏠
Working from home
View GitHub Profile
@Airdawg5571
Airdawg5571 / ipt
Last active October 18, 2023 07:01
More organized (pretty-printed) iptables output.
#!/bin/bash
# Written and tested on CentOS 7
iptables -nvL |cut -f -9|column -t| sed 's/^Chain/\n&/g'|sed '/^Chain/ s/[ \t]\{1,\}/ /g'|sed '/^[0-9]/ s/[ \t]\{1,\}/ /10g'
@mariochavez
mariochavez / 01-Notas.md
Last active June 17, 2020 18:18
Usando Docker con Rails

Usando Docker con Rails para hacer deploy a Producción

Instalar Docker

Hay que seguir las notas en https://docs.docker.com/installation/ para el sistema operativo que esten ejecutando.

Utilizando un contenedor para Postgresql

Vamos a utilizar un container ya listo para trabajar con Postgresql. El siguiente comando se encarga de descargar el container y de ejecutarlo. Si es necesario cambiar el valor de las variables POSTGRES_PASSWORD y POSTGRES_USER a unos más adecuados

$ docker run --name db -e POSTGRES_PASSWORD=manager -e POSTGRES_USER=rails -d postgres
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active October 21, 2022 20:10
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@Lerg
Lerg / prepare_icons.sh
Last active April 11, 2024 19:25
Make all app icons with imagemagick, iOS and Android
#!/bin/sh
base=$1
convert "$base" -resize '29x29' -unsharp 1x4 "Icon-Small.png"
convert "$base" -resize '40x40' -unsharp 1x4 "Icon-Small-40.png"
convert "$base" -resize '50x50' -unsharp 1x4 "Icon-Small-50.png"
convert "$base" -resize '57x57' -unsharp 1x4 "Icon.png"
convert "$base" -resize '58x58' -unsharp 1x4 "Icon-Small@2x.png"
convert "$base" -resize '60x60' -unsharp 1x4 "Icon-60.png"
convert "$base" -resize '72x72' -unsharp 1x4 "Icon-72.png"
convert "$base" -resize '76x76' -unsharp 1x4 "Icon-76.png"
@masbog
masbog / libgs_install.sh
Created June 17, 2014 07:50
Installing ghostscript 9 CentOS 6.5 with shared Library
curl -O http://downloads.ghostscript.com/public/ghostscript-9.14.tar.gz &&
tar -xzf ghostscript-9.14.tar.gz &&
cd ghostscript-9.14 &&
./configure &&
make install &&
make so &&
cp ghostscript-9.14/sobin/libgs.so.9.14 /usr/lib &&
ln -s /usr/lib/libgs.so.9.14 /usr/lib/libgs.so &&
mkdir -p /etc/ld.so.conf.d/ &&
echo "/usr/lib/libgs.so" > /etc/ld.so.conf.d/libgs.conf &&
@mezis
mezis / query_finder.sql
Last active April 28, 2022 15:17
Finding long-running queries in MySQL
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120)
FROM information_schema.processlist
WHERE command <> 'Sleep'
AND info NOT LIKE '%PROCESSLIST%'
ORDER BY time DESC LIMIT 50;
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ashrithr
ashrithr / csr.rb
Created June 20, 2013 05:10
ruby openssl
require 'openssl'
#
# Program to demonstrate Certificate Signing Request using openssl
#
# Create a new key
def gen_key(name)
key = OpenSSL::PKey::RSA.new 1024
file = File.new name, "w"
@marianposaceanu
marianposaceanu / linux_performance.md
Last active January 30, 2024 06:47
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@SammysHP
SammysHP / gist:5611986
Created May 20, 2013 12:41
Vim logo in ascii art
.
##############..... ##############
##############......##############
##########..........##########
##########........##########
##########.......##########
##########.....##########..
##########....##########.....
..##########..##########.........
....##########.#########.............