Skip to content

Instantly share code, notes, and snippets.

View paoloumali's full-sized avatar

Paolo Umali paoloumali

View GitHub Profile
sudo systemctl list-unit-files
@paoloumali
paoloumali / gist:2c8d149107f9dd5b345315c365e2885c
Last active February 24, 2022 04:47
Why one shouldn't be looking for the latest versions all the time
- With software, and even hardware, everything is under an ecosystem
- Getting the latest Intel doesn't mean you get all the bells and whistles. Not all software will harness all the power and features it may introduce
- Getting the latest wordpress doesn't mean smooth sailing. Not all themes and plugins will be ready for it. Do you believe all those plugins and theme you got for free can dedicate manpower to update their code every time there's a change? Have you done anything in your life for free? That's what open-source is at the core. But all that relies on it will move things for free.
- Getting latest PHP doesn't mean you're moving forward. Not all tools will be ready for it including your primary analysis tools, etc.
- Getting the recent released games doesn't mean all pleasant experience all the time. There are bugs to be caught.
So before you look at changing versions, focus on what matters.
Are you testing your code?
Are you using reliable plugins?
Have you focused on your page SEO?
@paoloumali
paoloumali / readme.md
Last active December 20, 2021 00:21
Auto-connect to hidden wifi network in Ubutu 20.04

Add systemd hidden_wifi_connect.service

vim /etc/systemd/system/hidden_wifi_connect.service

[Unit]
Description=Connect to hidden wifi network on start
Before=network.target

[Service]
- sudo update-alternatives --config editor
- set to vim.basic, i.e. vanilla vim
- sudo visudo
- stop password req for root things
- `umask 002` added in .bashrc
- set primary group as www-data
- created ~/sites folder
- chgrp www-data ~/sites
- chmod g+s ~/sites
- installed
HTTP caching is a scheme of showing same resource unless content needs to be regenerated by fetching it again from the web server.
HTTP objects may be a static resource or a dynamic page built by some backend language like PHP.
Tools used are (1) HTTP Reverse Proxy, e.g. Varnish and HAProxy. Cache server is hit first before web server. All fetch resource will be cached locally first by the proxy before sending it to the client. If cache is hit, web server won't be touched at all, i.e. no access log entry will be appended. Only the first request is slow.
Another tool used is HTTP Browser cache. It relies on headers ETag and Cache-Control
Apache Cache-Control
FileETag None
@paoloumali
paoloumali / gist:7e253a29b84f8e2c77ce54ae0d0e744a
Last active March 4, 2021 16:03
New ubuntu workstation first things
# enable ssh-server
ssh-keygen
sudo update-alternatives --config editor
# Choose vim.tiny
sudo apt install git
# Add dotfiles
git clone git@github.com:paoloumali/.files.git $HOME/.files
@paoloumali
paoloumali / bash-debug.md
Created February 22, 2021 15:39
Debug bash shell errors when started

I was noticing errors like

Command 'check' not found whenever I start a new bash shell. I turned out I uncommented a line in .bashrc which starts with check. I was able to figure it out by setting: set -x at the top

@paoloumali
paoloumali / gist:421dd1b08582731bf64baf938c045975
Last active February 22, 2021 07:22
vim key bindings in bash
Add in .bashrc below, then refresh session
```
set -o vi
bind '"jk":"\e"', do only if in control of all systems, stick with ESC for consistency
```
It defaults to insert mode, ESC/jk to go command mode.
## Benefits
@paoloumali
paoloumali / notes.md
Last active February 17, 2021 18:18
workstation pc, partitioning, and setup

Windows (games)

  • symlink files and user folders to shared and extended, i.e. desktop, downloads
  • enable indexing of s:/public/(downloads|docs|music|videos)
  • junctions
    • mklink /J C:\Users%username%.vagrant.d E:%username%.vagrant.d
    • mklink /J C:\Users%username%.vscode E:%username%.vscode

Ubuntu (work)

@paoloumali
paoloumali / utils-installation.md
Last active May 15, 2020 20:41
Installing utilities in ubuntu 20.04

Node

Composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer