Skip to content

Instantly share code, notes, and snippets.

View goeroeku's full-sized avatar

Agus Indra Cahaya goeroeku

View GitHub Profile
@vlucas
vlucas / encryption.js
Last active June 7, 2024 04:27
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@goeroeku
goeroeku / google.md
Last active August 2, 2020 11:03
import data email

enable to import

akses 2 link dibawah untuk mematikan security defautl google

https://accounts.google.com/b/0/DisplayUnlockCaptcha
https://www.google.com/settings/security/lesssecureapps

jgn lupa mengaktifkan pop2 pada email yg akan diimport

@goeroeku
goeroeku / Application-Utilities.md
Last active October 2, 2019 08:15
note about arch linux

Aplikasi pendukung

Ulauncher

https://ulauncher.io/

Scanner

EPSON L220

@bobbybouwmann
bobbybouwmann / User.php
Last active May 31, 2024 03:04
Laravel Absolute vs Relative Dates with Carbon
<?php
namespace App;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
/**
@h4n2k
h4n2k / gist:25e78325565ceed6af0e21264cd5c471
Created December 6, 2016 03:22
[nodemon] Internal watch failed: watch ENOSPC
[nodemon] 1.8.1
[nodemon] to restart at any time, enterrs
[nodemon] watching: *.*
[nodemon] startingnode app.js
[nodemon] Internal watch failed: watch ENOSPC
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@goeroeku
goeroeku / loadbalancer-nginx.md
Last active April 1, 2021 17:09
Install nginx

ex: vim /etc/nginx/sites-enabled/default

buat block pada site configurasi,tambahkan sejajar dengan block server{}

upstream php { 
  ip_hash;
  server unix:/run/php/php7.4-fpm.sock1 weight=100 max_fails=5 fail_timeout=5; 
  server unix:/run/php/php7.4-fpm.sock2 weight=100 max_fails=5 fail_timeout=5;
  server unix:/run/php/php7.4-fpm.sock; 
}
@goeroeku
goeroeku / CommandLine.md
Last active February 7, 2019 07:07
Some utilities app

batch rename extension to UPERCASE

for f in *.jpg; do mv "$f" "${f//jpg/JPG}"; done
@goeroeku
goeroeku / adminer.md
Last active November 13, 2018 04:58
Install adminer

install

wget -O d.php https://www.adminer.org/latest-en.php
@goeroeku
goeroeku / install-old-php-from-source.md
Last active March 28, 2020 11:40
Ubuntu/Debian - PHP & PHP Extension

Old PHP from Source

php 5.4

add old repo, ex jesie

deb http://kartolo.sby.datautama.net.id/debian/ jessie main contrib non-free
deb http://kartolo.sby.datautama.net.id/debian-security/ jessie/updates main contrib non-free
deb-src http://kartolo.sby.datautama.net.id/debian/ jessie main contrib non-free
@yegorg
yegorg / sysctl.conf
Created September 20, 2016 09:28
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.