Skip to content

Instantly share code, notes, and snippets.

View buonzz's full-sized avatar

Darwin Biler buonzz

View GitHub Profile
@buonzz
buonzz / unix_vs_linux.md
Last active March 22, 2020 11:12
Unix vs Linux

What is the difference between Linux and Unix?

Brief History

  • Unix is invented by Ken Thompson (UTF-8, Go) and Denis Ritchie (C)
  • Initially worked with MULTICS (run multiple programs, but is frustrated due to direction and scope of project
  • Ken and Denis worked in UNICS (one program at a time) as an alternative (over time, gets called Unix)
  • C become mature, they rewrite the Unix using C
  • AT&T is forbidden to enter the market, licensed the source code
  • various universities uses it, one of them is Berkeley
@buonzz
buonzz / compile_php.sh
Created March 21, 2020 15:24
Compiling PHP
# extensions
sudo apt-get install \
libxml2-dev \
libcurl4-openssl-dev \
libjpeg-dev \
libpng-dev \
libxpm-dev \
libmysqlclient-dev \
libpq-dev \
libicu-dev \
@buonzz
buonzz / gitsheet.sh
Last active September 13, 2020 09:14
Git CheatSheet
# signing tags and commits - https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work
# verify if you have gpg keys
gpg --list-keys
# generate one
gpg --gen-key
# short last commit sha
git rev-parse --short HEAD
@buonzz
buonzz / auth-prot.sql
Last active July 17, 2020 14:51
Client does not support authentication protocol requested by server; consider upgrading MySQL client
ALTER USER 'user'@'%' IDENTIFIED WITH mysql_native_password BY 'pass;
-- or
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
@buonzz
buonzz / npm.sh
Created August 3, 2019 09:34
npm
# login to your account
npm adduser
# publish a package: updated first the version in package.json
npm publish .
@buonzz
buonzz / .env
Created July 13, 2019 23:31
Dockerized Laravel - env file
## Docker-compose configurations
WORKSPACE_TIMEZONE=UTC
# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=./
# Point to where the `APP_CODE_PATH_HOST` should be in the container. You may add flags to the path `:cached`, `:delegated`. When using Docker Sync add `:nocopy`
APP_CODE_PATH_CONTAINER=/var/www:cached
@buonzz
buonzz / docker-compose.yml
Created July 13, 2019 23:29
Laravel dockerized - docker-compose file
version: '3'
networks:
frontend:
driver: ${NETWORKS_DRIVER}
backend:
driver: ${NETWORKS_DRIVER}
volumes:
mysql:
@buonzz
buonzz / docker-in-amazon-linux.sh
Last active July 3, 2019 23:43
setup docker in amazon linux
// Download the keypair file
// Set the permission to 400
// Connect to the box -
ssh -i keypair_file.pem ec2-user@yourinstance.compute-1.amazonaws.com
// update packages
sudo yum update -y
// install docker
@buonzz
buonzz / wordpress_cheatsheet.php
Last active May 18, 2019 10:13
wordpress cheatsheet
// register a function taht will register the menus
add_action( 'admin_menu', 'the_function_that_will_add_menu' );
// the function that will add menu
function the_function_that_will_add_menu() {
add_options_page( 'My Plugin Options', 'My Plugin', 'manage_options', 'my-unique-identifier', 'my_plugin_options' );
}
// function to add top level menu
add_menu_page
@buonzz
buonzz / LX0-103.sh
Last active March 14, 2019 15:34
LX0-103.sh
# System Architecture (14%)
dmesg
udev
dbus
lsusb
lspci
sysfs
/sys
/proc
/dev