Skip to content

Instantly share code, notes, and snippets.

View amrikarisma's full-sized avatar
💭
I may be slow to respond.

Amri amrikarisma

💭
I may be slow to respond.
View GitHub Profile
@amrikarisma
amrikarisma / README.md
Created October 27, 2024 11:07 — forked from gilangvperdana/README.md
IPTables Script

Inject IP Tables

#/bin/bash
iptables -t nat -v -L -n --line-number
echo -n "IP VM who want to exposed (x.x.x.x:port): "
read ip_vm
echo $ip_vm

echo -n "Enter Port Access: " 
read port
@amrikarisma
amrikarisma / PFwithSSH.md
Created October 27, 2024 11:06 — forked from gilangvperdana/PFwithSSH.md
Port Forwarding on Ubuntu

Local Forwarding

If you want to locally access a cloud application that has the address 192.168.100.2:82 and can only be reached by your VM, you can use the technique below. That way you can access your local localhost:80.

ssh -L LocalPortAccess:AppsIPAddresses:AppsPortAddresses user@VPSPublicIP -pXXXX
ssh -L 80:127.0.0.1:30001 [email protected] -p10013

Remote Forwarding

If you want to access your local application with the application address 127.0.0.1:30001 then you can access it on your VPS on port 80 you can use the technique below:

@amrikarisma
amrikarisma / Android_10 build.prop_editing.md
Created September 4, 2024 10:13 — forked from wsoyka/Android_10 build.prop_editing.md
How to edit build.prop on Android

Since various build.prop editor apps didnt work for me on Lineage 17.x, here the way I managed to edit build.prop:

  1. via Termux/Terminal:
mount -o remount,rw /
nano /system/build.prop
  1. edit to your hearts content - I usually bring down media vol steps: ro.config.media_vol_steps=15
@amrikarisma
amrikarisma / Javascript Format NPWP
Created April 4, 2023 04:57 — forked from yudapc/Javascript Format NPWP
Javascript Format NPWP. NPWP is ID tax each people of indonesian. Specificly in frontend need to format NPWP before render to user
//
// Javascript Format NPWP
//
function formatNpwp(value) {
if (typeof value === 'string') {
return value.replace(/(\d{2})(\d{3})(\d{3})(\d{1})(\d{3})(\d{3})/, '$1.$2.$3.$4-$5.$6');
}
}
@amrikarisma
amrikarisma / functions.php
Created January 24, 2023 10:31 — forked from ChrisLTD/functions.php
Fix so you can preview ACF field changes in Wordpress admin
<?php
/*
Debug preview with custom fields
Taken from: http://support.advancedcustomfields.com/forums/topic/preview-solution/
See also: http://support.advancedcustomfields.com/forums/topic/2nd-every-other-post-preview-throws-notice/
*/
add_filter('_wp_post_revision_fields', 'add_field_debug_preview');
function add_field_debug_preview($fields){
$fields["debug_preview"] = "debug_preview";
return $fields;
@amrikarisma
amrikarisma / spintax.php
Created September 3, 2017 15:31 — forked from irazasyed/spintax.php
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
* @name Spintax
* @author Jason Davis - https://www.codedevelopr.com/
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/
*/
class Spintax
{
public function process($text)
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:text="Guest List"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />