Skip to content

Instantly share code, notes, and snippets.

View omkz's full-sized avatar
🏠
Working from home

Kurnia Muhamad omkz

🏠
Working from home
View GitHub Profile
@omkz
omkz / stimulus.md
Created January 1, 2022 16:26 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@omkz
omkz / ruby_on_rails_deployment.md
Created December 14, 2021 15:36 — forked from zentetsukenz/ruby_on_rails_deployment.md
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |
fastboot erase userdata
@omkz
omkz / rails-log.md
Created January 31, 2021 18:46
Limiting Rails applications logs on Ubuntu server

Kebetulan mendapatkan kesempatan fixing aplikasi Rails milik client yang down. Web servernya menggunakan apache dan passenger. Saya cek lognya ternyata kehabisan space SSD. kemudian saya coba mencarinya file-file dengan ukuran besar(diatas 100MB) dengan perintah:

sudo find / -type f -size +100M -exec ls -lh {} \;

ternyata error.log milik apache2 berukuran 7 Giga lebih. Hindari menghapus dengan perintah rm karena file tersebut akan di lock oleh apache2, saya menggunakan command:

@omkz
omkz / rvm.md
Last active January 16, 2021 14:39
rvm uninstall

$ env | grep rvm

uninstall: Here is a custom script which we name as 'cleanout-rvm'. While you can definitely use 'rvm implode' as a regular user or 'rvmsudo rvm implode' for a system wide install, this script is useful as it steps completely outside of RVM and cleans out RVM without using RVM itself, leaving no traces.

#!/bin/bash
/usr/bin/sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm
/usr/bin/sudo /usr/sbin/groupdel rvm
/bin/echo "RVM is removed. Please check all .bashrc|.bash_profile|.profile|.zshrc for RVM source lines and delete
or comment out if this was a Per-User installation."
@omkz
omkz / gist:e0fe5512429969d47eccbcca51bdfb72
Created December 18, 2020 15:27
Create the same postgres user as the linux user

First, switch to the postgres system user account

sudo su - postgres

To create a user, type the following command(Enter the same user and password as the Linux user)

createuser --interactive --pwprompt
@omkz
omkz / gist:4e784f46193f0b5b094cd25c80a60202
Last active April 21, 2023 11:48
Setup Ruby on Rails on Ubuntu 20.04 for development machine
# zsh
sudo apt-get install zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s $(which zsh)
# rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
@omkz
omkz / office2016.txt
Created August 29, 2020 03:34 — forked from Dhanvesh/office2016.txt
Microsoft Office 2016 Activation code
@echo off
title Activate Microsoft Office 2016 ALL versions for FREE!&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2016&echo - Microsoft Office Professional Plus 2016&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&ech
@omkz
omkz / socialSharePopups.js
Created July 20, 2020 14:30 — forked from josephabrahams/socialSharePopups.js
Facebook & Twitter Share Popup Windows
(function($) {
$('.js-share-twitter-link').click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
window.open(href, "Twitter", "height=285,width=550,resizable=1");
});
$('.js-share-facebook-link').click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
window.open(href, "Facebook", "height=269,width=550,resizable=1");