Skip to content

Instantly share code, notes, and snippets.

View dedenf's full-sized avatar

Deden Fathurahman dedenf

View GitHub Profile
curl -X POST \
https://id-fm.discoverelement.com:9443/sdk/ocr/konvergen \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 139061' \
-H 'Host: id-fm.discoverelement.com:9443' \
-H 'Postman-Token: fd18b1c0-2e9f-41f0-9608-21fbf51b8a1b,d73df234-85ec-4dc9-9d05-79d5443e6d93' \
-H 'User-Agent: PostmanRuntime/7.16.3' \
config.vm.define "server4" do |server4|
server4.vm.box = "ubuntu/trusty64"
# config.vm.box_check_update = false
server4.vm.network "forwarded_port", guest: 80, host: 8014
server4.vm.network "forwarded_port", guest: 22, host: 2226
server4.vm.network "private_network", ip: "172.31.15.213"
server4.vm.hostname = "cantik-app01"
server4.vm.synced_folder "/Users/dedenf/Sites/cantik/apicantik", "/home/vagrant/www/apicantik", owner: "vagrant", group: "vagrant", :mount_options => ["dmode=777", "fmode=666"]
server4.vm.synced_folder "/Users/dedenf/Sites/cantik/apis-cantik.io", "/home/vagrant/www/apis-cantik.io", owner: "vagrant", group: "vagrant", :mount_options => ["dmode=777", "fmode=666"]
@dedenf
dedenf / ssh-tmux.md
Last active May 3, 2016 07:37
ssh to server and beam up tmux automatically

Basic Command

ssh -t user@server "tmux attach-session -t session_name || tmux new-session -s new_session_name"

full .sh

    #!/bin/bash
    set -e

server=$1

Keybase proof

I hereby claim:

  • I am dedenf on github.
  • I am dedenf (https://keybase.io/dedenf) on keybase.
  • I have a public key ASA_wSekWdTNUSs6J7UA2OMurDV60WctzL2oL-YAzdfziQo

To claim this, I am signing this object:

tomorrow is your big day, i'm happy for you, genuinely very much.
you are one of the few person that i look upon,
you are one person that i'll take the risk if it's rewarding
you taught me a lot of things, remember you taught me regex in my small room?
altough i still cant master it...., but i do remember all of it.
you always wanna push me into my limit, and i did.
server {
listen 80;
server_name api.erafone.com;
root /home/www-data/srv/api/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ @rewrites;
autoindex on;
MariaDB [dprms1]> show engine innodb status\G
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
140110 7:06:10 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 14 seconds
-----------------
#!/bin/bash
echo "Enter a domain (e.g. example.com):";
read domain;
echo ""
echo "Enter a virtual host name (e.g. dev, as in dev.example.com
Just enter only the virtual host name)"
read vhname
echo ""
@dedenf
dedenf / lastfm
Last active January 16, 2017 04:48
php script to fetch your last listened track on lastfm, an you can add this to your hooks or commit message $(lasfm)
#!/usr/bin/php
<?php
$url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=USERNAME&api_key=YOU_API_KEY&format=json&limit=1";
// Initializing curl
$ch = curl_init($url);
$options = array(
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => array('Content-type: application/json')
/* H5BP image replacement: http://nicolasgallagher.com/another-css-image-replacement-technique/ */
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}