Skip to content

Instantly share code, notes, and snippets.

View ebta's full-sized avatar

Ebta Setiawan ebta

View GitHub Profile
@ebta
ebta / lets-encrypt-certbot.md
Created October 1, 2021 03:51
Install Lets Encrypt (Certbot) in Ubuntu 20.04 LTS

Installing Certbot

sudo apt install certbot python3-certbot-nginx

Verifying Certbot Auto-Renewal

sudo systemctl status certbot.timer
@ebta
ebta / docker-install.md
Last active December 19, 2023 14:07
Installing docker (latest version) on Ubuntu 20.04

Installing docker on Ubuntu 20.04 / 22.04

Full reference here: https://docs.docker.com/engine/install/ubuntu/

Setup the repository

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release

Add Docker’s official GPG key:

@ebta
ebta / mysq-install.md
Last active January 17, 2022 07:09
Install MySQL Server on Ubuntu 20.04 LTS

Installing MySQL

Update the package index on your server

sudo apt update && sudo apt upgrade -y

Install MySQL Server

sudo apt install mysql-server

Configuring MySQL

@ebta
ebta / docker-mysql-adminer.md
Last active September 21, 2021 14:39
Docker tips dan trick

MySQL 5.6 + adminer

Example docker compose save as ex. mysql-5.6-adminer.yml

version: '3.1'
services:
  db56:
    image: mysql:5.6
    command: --default-authentication-plugin=mysql_native_password
    restart: always
 environment:
@ebta
ebta / wp-update.sh
Last active August 31, 2021 14:22
Update worpress, plugins and theme using wp-cli from Cron
#!/bin/sh
# Simple script to update a WordPress install (core, plugins, themes and languages) using wp-cli.
# Usually we expect to run this from cron.
# Written by Kitson Consulting and released into the public domain.
if [ $# -ne 1 ]
then
echo "Usage: $0 </path/to/wordpress/install>" >&2
exit 1
fi
@ebta
ebta / change root password.md
Created July 13, 2021 06:59
Change mysql root password (MySQL 5.7)

Stop your databases

service mysqld stop

Modify /etc/my.cnf file add skip-grant-tables

sudo nano /etc/my.cnf

Add skip-grant-tables in [mysqld] section

@ebta
ebta / phpsvc.ini
Last active June 23, 2021 05:06
Run php application (cli) as service (daemons) in Ubuntu
# Save this file ex. /etc/systemd/system/myapp.service
# then run using: systemctl <start|status|restart|stop|enable> myapp
[Unit]
Description=My PHP APP Service
# May your script needs MySQL or other services to run, eg. MySQL Memcached
Requires=mysqld.service memcached.service
After=mysqld.service memcached.service
[Service]
@ebta
ebta / codeiginter-server-config.md
Created June 15, 2021 02:33 — forked from yidas/codeiginter-server-config.md
Codeigniter 3 server configuration for Nginx & Apache

Codeigniter 3 server configuration for Nginx & Apache

Web Server Site Configuration

Recommended Apache Configuration

Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot and ServerName fit to your environment:

@ebta
ebta / cronjob-check.md
Last active May 11, 2021 02:24
Check/verify cronjob crontab Linux Running

Cronjob Check

Referensi: https://askubuntu.com/a/85560

Do not redirect error output to /dev/null and grep /var/log/syslog for cron output.

grep cron /var/log/syslog

You can immediately show errors when saving a file after editing /etc/crontab or files inside /etc/cron.d/ with:

tail -f /var/log/syslog | grep --line-buffered cron
@ebta
ebta / open-vpn-ubuntu-20.04.md
Last active June 10, 2024 10:22
Easy way setup or install VPN OpenVPN on Ubuntu 20.04

1. Update your system

First, run the apt command to apply security updates:

sudo apt update
sudo apt upgrade

2. Download and run openvpn-install.sh script

DOwnload installation script using short url as follow and update chmod :

wget https://git.io/vpn -O openvpn-ubuntu-install.sh