Skip to content

Instantly share code, notes, and snippets.

View anovanmaximuz's full-sized avatar
🌴
On vacation

Ano Van anovanmaximuz

🌴
On vacation
View GitHub Profile
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU
GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3
Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En
mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx
NrRFi9wrf+M7Q== your_email@pasarkode.com
$ ssh-keygen -t rsa -b 4096 -C "your_email@pasarkode.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/pasarkode/.ssh/id_rsa):
Created directory '/home/pasarkode/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/pasarkode/.ssh/id_rsa.
Your public key has been saved in /home/pasarkode/.ssh/id_rsa.pub.
The key fingerprint is:
d0:82:24:8e:d7:f1:bb:9b:33:53:96:93:49:da:9b:e3 your_email@pasarkode.com
@anovanmaximuz
anovanmaximuz / Libs_Logging.php
Created January 11, 2016 18:19
Library Loggin PHP
<?php
if(!defined('LOG_SUMMARY')) define('LOG_SUMMARY', 0); /* Summary */
if(!defined('LOG_EMERG')) define('LOG_EMERG', 1); /* System is unusable */
if(!defined('LOG_ALERT')) define('LOG_ALERT', 2); /* Immediate action required */
if(!defined('LOG_CRIT')) define('LOG_CRIT', 3); /* Critical conditions */
if(!defined('LOG_ERR')) define('LOG_ERR', 4); /* Error conditions */
if(!defined('LOG_WARNING')) define('LOG_WARNING', 5); /* Warning conditions */
if(!defined('LOG_NOTICE')) define('LOG_NOTICE', 6); /* Normal but significant */
if(!defined('LOG_INFO')) define('LOG_INFO', 7); /* Informational */
if(!defined('LOG_DEBUG')) define('LOG_DEBUG', 8); /* Debug-level messages */
@anovanmaximuz
anovanmaximuz / flusher.php
Created September 3, 2015 14:12
Notification
<?php
require_once dirname(__FILE__) . '/models/workers.php';
require_once dirname(__FILE__) . '/models/notification.php';
class Modules_Plugin_Flusher {
protected $config;
protected $logger;
protected $activity;
@anovanmaximuz
anovanmaximuz / clas.push.php
Created September 3, 2015 10:48
Push Notification Classes PHP
<?php
/**
* Copyright 2014 Shop-Wiz.Com.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@anovanmaximuz
anovanmaximuz / Curl.php
Created September 3, 2015 10:40
Curl Library for CodeIgniter
<?php
/**
* CodeIgniter Curl Class
*
* simple curl to remote server call
*
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author Ano Van
@anovanmaximuz
anovanmaximuz / AndroidPushNotification.php
Last active September 3, 2015 10:38
android push notification
<?php
set_time_limit(0);
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'API-KEY-HERE' );
//this ID only get from Android device
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@anovanmaximuz
anovanmaximuz / push_apns.php
Last active September 3, 2015 10:34 — forked from SiriusDely/push_apns.php
Push Notification PHP Script - Apple iOS, Android C2DM, BlackBerry PPG
<?php
// Put your device token here (without spaces):
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Put your private key's passphrase here:
$passphrase = 'xxxxxxx';
// Put your alert message here:
$message = 'A push notification has been sent!';
@anovanmaximuz
anovanmaximuz / gist:d27453678e201192bf49
Last active September 3, 2015 06:56 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array