Skip to content

Instantly share code, notes, and snippets.

View donnykurnia's full-sized avatar

Donny Kurnia donnykurnia

View GitHub Profile
@donnykurnia
donnykurnia / read-text-message.sh
Created October 6, 2023 06:28 — forked from FinnWoelm/read-text-message.sh
How to read text messages from USB modem
# Full instructions: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html
# Examples: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html#examples
# Supported modems: https://www.freedesktop.org/wiki/Software/ModemManager/SupportedDevices/
# Get list of connected modems.
mmcli --list-modems
# Output:
# Found 1 modems:
# /org/freedesktop/ModemManager1/Modem/1 [huawei] E3531
# The number at the end of the path is the modem index.
@donnykurnia
donnykurnia / Shell
Created January 10, 2020 14:18 — forked from evgenyneu/Shell
Calling rollbar deployment webhook
ACCESS_TOKEN=secret
ENVIRONMENT=production
LOCAL_USERNAME=`whoami`
REVISION=`git log -n 1 --pretty=format:"%H"`
curl https://api.rollbar.com/api/1/deploy/ \
-F access_token=$ACCESS_TOKEN \
-F environment=$ENVIRONMENT \
-F revision=$REVISION \
-F local_username=$LOCAL_USERNAME
@donnykurnia
donnykurnia / example.php
Created December 10, 2012 18:15
Wordpress menu generator
// import socialniho menu
$top = new Menu('Top menu');
// page link
if ($page = get_page_by_path('some-page')) {
$top->title('Page');
$top->object_id($page->ID);
$top->object('page');
$top->type('post_type');
$top->save();
function formatUSprice(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);