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
@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
@alexserver
alexserver / rest-basics.md
Created October 28, 2015 18:56
REST basics, Theory, Principles, and examples.

RESTful API know-how

Motivation

I place my learning process in this document with 2 motives:

  1. To have a quick guide whenever I lost the track of knowledge.
  2. To share the knowledge with anyone wants to learn RESTful APIs

1. Before, some theory

@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"
@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

@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'
@SammysHP
SammysHP / gist:5611986
Created May 20, 2013 12:41
Vim logo in ascii art
.
##############..... ##############
##############......##############
##########..........##########
##########........##########
##########.......##########
##########.....##########..
##########....##########.....
..##########..##########.........
....##########.#########.............
@richieforeman
richieforeman / makeauthority.sh
Created July 23, 2012 21:38
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@morimori
morimori / 1.9.3-p0.log
Created November 1, 2011 07:29
ruby Digest::* benchmark
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
Rehearsal ------------------------------------------
MD5 1.010000 0.000000 1.010000 ( 1.026340)
SHA1 1.710000 0.000000 1.710000 ( 1.724464)
SHA2 3.780000 0.000000 3.780000 ( 3.824757)
SHA256 3.460000 0.010000 3.470000 ( 3.498111)
--------------------------------- total: 9.970000sec
user system total real
MD5 1.020000 0.000000 1.020000 ( 1.025751)
@tmslnz
tmslnz / dnsmasq.md
Last active March 20, 2023 07:07
Setting up dnsmasq on OS X

Install dnsmasq

Via brew or other method

Set up DNS resolver order

In order to work on every connection and on any TLD, dnsmasq needs to be the first DNS resolver receving the query.

And since dnsmasq is a local process, all DNS queries need to go to 127.0.0.1

On macOS, /etc/resolv.conf is automaticaly created, depending on a variety of things (network settings, etc), so it cannot be edited.