#/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
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
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:
Since various build.prop editor apps didnt work for me on Lineage 17.x, here the way I managed to edit build.prop:
- via Termux/Terminal:
mount -o remount,rw /
nano /system/build.prop
- edit to your hearts content - I usually bring down media vol steps:
ro.config.media_vol_steps=15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PRESET_NET_WIFI_ENABLED=1 | |
PRESET_NET_ETHERNET_ENABLED=1 | |
PRESET_NET_WIFI_SSID='Wifi network name' | |
PRESET_NET_WIFI_KEY='Wifi password' | |
PRESET_NET_WIFI_COUNTRYCODE='ID' | |
PRESET_CONNECT_WIRELESS=n | |
SET_LANG_BASED_ON_LOCATION=n | |
PRESET_LOCALE=en_US.UTF-8 | |
PRESET_TIMEZONE=Asia/Jakarta | |
PRESET_ROOT_PASSWORD=tester123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create custom function and custom rss template. | |
* URL : /feed/feedname | |
* When url 404 not found, please open permalink setting then try again. | |
*/ | |
add_action('init', 'customRSS'); | |
function customRSS(){ | |
add_feed('feedname', 'customRSSFunc'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(ABSPATH . 'wp-admin/includes/image.php'); | |
// Put the function in a class to make it more extendable | |
class KRS_regen_media | |
{ | |
public function krs_regenerate($imageId) | |
{ | |
$imagePath = wp_get_original_image_path($imageId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function scopeWithPrice($smartphone) | |
{ | |
$queryGetMinPrice = $smartphone->select([ | |
'*', | |
'price' => ProductPrice::select('price')->where('priceable_type', Smartphone::class)->whereColumn('priceable_id', 'smartphones.id')->orderBy('price', 'ASC')->take(1) | |
]); | |
return $queryGetMinPrice; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="file" accept="image/*" onchange="loadFile(event)"> | |
<img id="output"/> | |
<script> | |
var loadFile = function(event) { | |
var output = document.getElementById('output'); | |
output.src = URL.createObjectURL(event.target.files[0]); | |
output.onload = function() { | |
URL.revokeObjectURL(output.src) // free memory | |
} | |
}; |
NewerOlder