Skip to content

Instantly share code, notes, and snippets.

View ebta's full-sized avatar

Ebta Setiawan ebta

View GitHub Profile
@ebta
ebta / clean.sh
Created May 19, 2024 14:03 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@ebta
ebta / open-vpn-ubuntu-20.04.md
Last active April 18, 2024 12:35
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
@ebta
ebta / dat2mp4.bat
Created April 24, 2016 14:58
Fast convert VCD (*.dat) to MP4 with ffmpeg
"C:\Dir\ffmpeg\bin\ffmpeg" -i %1 -vcodec copy -acodec copy "F:\TargetDir\%~n1.mp4"
@ebta
ebta / embedded-file-viewer.md
Last active March 26, 2024 06:43 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@ebta
ebta / install-sqlserver-php.md
Last active March 15, 2024 06:35
Install Microsoft SQL Server PHP Driver on Ubuntu
@ebta
ebta / full_join.sql
Created July 27, 2018 08:57
How to do FULL [OUTER] JOIN in MySQL (MariaDB)
-- First method
SELECT * FROM t1
LEFT JOIN t2 ON t1.id = t2.id
UNION
SELECT * FROM t1
RIGHT JOIN t2 ON t1.id = t2.id
-- Second Method
-- The query above works for special cases where a FULL OUTER JOIN operation would not produce any duplicate rows.
-- The query above depends on the UNION set operator to remove duplicate rows introduced by the query pattern.
@ebta
ebta / nginx-location.md
Created November 17, 2023 01:50
Nginx Location block Tutorial

Nginx location:

Nginx location block section have a search order, a modifier, an implicit match type and an implicit switch to whether stop the search on match or not. the following array describe it for regex.


# --------------------------------------------------------------------------------------------------------------------------------------------
# Search-Order       Modifier       Description                                                        Match-Type        Stops-search-on-match
# --------------------------------------------------------------------------------------------------------------------------------------------
#     1st               =           The URI must match the specified pattern exactly                  Simple-string              Yes
@ebta
ebta / compile-fossil.sh
Last active December 27, 2023 03:50
Compile Fossil from Source Tarball
# Kompile fossil di Ubuntu Server
# Download fossil source tarball dari halaman download
# https://fossil-scm.org/home/uv/download.html
# Misal untuk versi 2.23
# wget https://fossil-scm.org/home/tarball/47362306a7dd7c6fc3cab77cebe5d25469b0a9448479d9718eb5c49c8337b29/fossil-src-2.23.tar.gz
# extract dengan
tar -xzf fossil-src-2.23.tar.gz
# masuk ke directory extract
cd fossil-src-2.23
@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 / fossil-nginx.conf
Last active September 28, 2023 14:36
Run Fossil Server in Linux using NGINX as SCGI
# Jalankan service fossil dengan syntax berikut (sesuaikan port)
# /usr/local/bin/fossil server --port 12345 --scgi /dir/location/data/repo
# Atau dibuat service agar bisa otomatis startup melalui script berikut :
# https://gist.github.com/ebta/1c30036d477289d7d33f847497566390
server {
server_name therepo.domain.com;
root /usr/local/bin/fossil;
location / {
scgi_param REQUEST_METHOD $request_method;