Skip to content

Instantly share code, notes, and snippets.

View leolemos's full-sized avatar

Leonardo Lemos leolemos

View GitHub Profile
@shrwnsan
shrwnsan / .bash_aliases
Last active July 12, 2024 10:25
Webhost .dotfiles
# Alias: Files & Folders
alias ls="ls --color=auto"
alias la="ls -aF"
alias lc="ls -lcr"
alias ld="ls -ld"
alias lk="ls -lSr"
alias ll="ls -lF"
alias lla="ls -al"
alias lm="ls -al | more"
alias lr="ls -lR"
@willurd
willurd / dotpath.sh
Last active May 15, 2023 06:12
Manage your PATH with a nice, one-directory-per-line file, rather than a gargantuan blob of colon-delimited text.
# Read the contents of ~/.path into $PATH, if ~/.path exists. ~/.path should be a file
# consisting of one path on each line, such as:
#
# ~$ cat ~/.path
# # vim: ft=sh
# ~/usr/bin
# /opt/local/bin
# ... etc ...
#
# Note that comments begin with a hash (#).
@willurd
willurd / web-servers.md
Last active July 28, 2025 05:58
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@vasanthk
vasanthk / System Design.md
Last active July 26, 2025 22:28
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jniltinho
jniltinho / install-phpmyadmin-ispconfig.sh
Last active October 20, 2023 08:03
Install phpMyAdmin on ISPConfig
#!/bin/bash
## Install phpMyAdmin on ISPConfig
## Debian 9 or Ubuntu (Apache2 and Nginx)
## phpMyAdmin 4.8.3
cd /tmp/
get_file=https://files.phpmyadmin.net/phpMyAdmin/4.8.3/phpMyAdmin-4.8.3-all-languages.tar.gz
wget ${get_file}
tar -xzvf $(basename ${get_file})
rm -f $(basename ${get_file}) && mv phpMyAdmin-*-all-languages myadmin
@autoize
autoize / backupToB2.sh
Created September 8, 2017 17:20
NextCloud Backup to BackBlaze B2
#!/bin/sh
# NextCloud to BackBlaze B2 Backup Script
# Author: Autoize (autoize.com)
# This script creates an incremental backup of your NextCloud instance at BackBlaze's off-site location.
# BackBlaze B2 is an object storage service that is much less expensive than using Amazon S3 for the same purpose, with similar versioning and lifecycle management features.
# Uploads are free, and storage costs only $0.005/GB/month compared to S3's $0.022/GB/month.
# Requirements
@autoize
autoize / optimizeNextCloud.sh
Created September 18, 2017 04:35
NextCloud Optimization Script
#!/bin/bash
# NextCloud Optimization Script
# with PHP Opcache and Redis Memcache
# Important: Do not run until the setup wizard in your browser is complete (has initialized the config.php file).
# Author: Autoize (autoize.com)
upload_max_filesize=4G # Largest filesize users may upload through the web interface
post_max_size=4G # Same as above
memory_limit=512M # Amount of memory NextCloud may consume
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 27, 2025 05:29
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@jult
jult / sysctl.conf
Last active June 17, 2025 13:38
[Debian 12 update!] sysctl config for linux server with 32 GB DDR RAM or more, SSD and 1Gbe (or faster) NIC
# IPv6 Configuration
# -> note that I have disabled ip6 for our internet-connection (wan/eth0) because
# -> my upstream/ISP (still) does not do IPv6. The rest, even localhost, does ip6 stuff.
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
net.ipv6.conf.eth0.disable_ipv6 = 1
net.ipv6.conf.wan.disable_ipv6 = 1
# Packet Forwarding
@jult
jult / jbt-rules.cf
Last active March 9, 2025 15:31
SpamAssassin rules
# Put this file under /etc/spamassassin/ and run an sa-update or reload amavis etc.
#
#--------------------------------------------------
# The only RBL I trust, UCEPROTECT1 (single IP, not IP-ranges or entire ISPs) http://uceprotect.net
#--------------------------------------------------
header RCVD_IN_UCEPROTECT1 eval:check_rbl_txt('uceprotect1', 'dnsbl-1.uceprotect.net')
describe RCVD_IN_UCEPROTECT1 Listed in dnsbl-1.uceprotect.net
tflags RCVD_IN_UCEPROTECT1 net
score RCVD_IN_UCEPROTECT1 1.8