Skip to content

Instantly share code, notes, and snippets.

Bunlong Heng bunlongheng

Block or report user

Report or block bunlongheng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fileCleanUpRecursive.py
# --------------------------------------------------------------
# Goal : Remove file base on input match
# Run : curl 45.55.88.57/code/fileModifier.py | python3
import os
import sys
rootdir = os.path.abspath(os.curdir)
print(rootdir)
View loopThroughAnObject.js
console.log("Environment variables----------------")
let variables = pm.environment.toObject();
console.log(variables)
console.log(typeof (variables)) //object
Object.keys(variables).forEach(function(key) {
console.log(key, variables[key]);
});
console.log("-------------------------------------")
View sendEmail. applescript.applescript
set recipientName to "Zuse"set recipientAddress to "sybunlongheng@gmail.com"set theSubject to "Subject" -- leave empty set theContent to "https://picsum.photos/200/300/?random"tell application "Mail" ##Create the message set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true} ##Set a recipient tell theMessage make new to recipient with properties {name:recipientName, address:recipientAddress} ##Send the Message send end tellend tell
View angularjs.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf 8">
<title>Guru99</title>
</head>
<body ng-app="app">
<h1 ng-controller="HelloWorldCtrl">{{message}}</h1>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
<script src="app.js"></script>
View es_input.cfg
<?xml version="1.0"?>
<inputList>
<inputConfig type="joystick" deviceName="GPIO Controller 1" deviceGUID="15000000010000000100000000010000">
<input name="a" type="button" id="1" value="1" />
<input name="b" type="button" id="0" value="1" />
<input name="hotkey" type="button" id="6" value="1" />
<input name="pagedown" type="button" id="5" value="1" />
<input name="pageup" type="button" id="4" value="1" />
<input name="select" type="button" id="6" value="1" />
<input name="start" type="button" id="7" value="1" />
View controller.fortinet.js
const FortinetService = require("../services").Fortinet;
module.exports = (config, jwtDecode) => {
let fortinet = {};
/**
* Login
*
* @return {object} response
*/
fortinet.login = async (req, res, next) => {
View policy-factory
const Account = require('../services').Account;
const FortinetService = require("../services").Fortinet;
const SSCService = require("../services").SSC;
const kue = require('kue');
const dotenv = require('dotenv').config();
const queue = kue.createQueue({redis: process.env.REDIS_URL});
module.exports = (config) => {
View index.js
const jwt = require('jwt-express');
const bodyParser = require('body-parser');
const controllers = require('../controllers');
module.exports = (app) => {
app.get('/', (req, res) => res.status(200).send({
message: 'Welcome to the API!',
}));
@bunlongheng
bunlongheng / Fortinet.php
Created Mar 6, 2018
Fortinet Model API between the portal
View Fortinet.php
<?php
namespace App\Models;
use App\CURL;
use Redirect;
use Session;
//SSC.cfg
$GLOBALS['FG_API'] = 'http://172.18.58.25/jsonrpc';
$GLOBALS['PKG_NAME'] = 'CARWASH_PKG_VPN';
View vm-cfg-backup.sh
path="/home/benu/backup"
if [ -d $path ]
then
echo "Directory $path exists."
echo "Remove old path"
rm -rf $path
echo "Create new path"
mkdir $path
You can’t perform that action at this time.