Skip to content

Instantly share code, notes, and snippets.

Ali Borhani alibo

Block or report user

Report or block alibo

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
@alibo
alibo / ilo3_g7.py
Created Nov 10, 2018
Getting Health information from FUCKING old ilo3 on g7
View ilo3_g7.py
# issue: https://github.com/seveas/python-hpilo/issues/189
# thanks to @Shados: https://github.com/seveas/python-hpilo/issues/189#issuecomment-430893230
import re
import ssl
import json
import hpilo
ilo3_context = ssl.create_default_context()
@alibo
alibo / sites.conf
Last active Nov 5, 2018
How to send traffic of some endpoints to a different app in Nginx (php + golang)
View sites.conf
upstream @api_golang {
server 127.0.0.1:8080; # same node
server 111.222.111.222:8080;
}
upstream @api_php {
server 127.0.0.1:80; # nginx/apache/... - another node
server 111.222.111.222:80; # nginx/apache/... - another node
}
@alibo
alibo / cross-compile_filebeat_arm.sh
Created Jan 13, 2018 — forked from anis-campos/cross-compile_filebeat_arm.sh
Cross-compile Elastic Filebeat for ARM with docker. Works Raspberry Pi 2
View cross-compile_filebeat_arm.sh
#----- Create a Docker for cross-compilation -----#
mkdir build && cd $_
docker run -it --rm -v `pwd`:/build golang:1.8.3 /bin/bash
#----- Inside docker -----#
go get github.com/elastic/beats
cd /go/src/github.com/elastic/beats/filebeat/
git checkout v5.6.3
GOARCH=arm go build
cp filebeat /build
exit
@alibo
alibo / s3-slack-notifier-lambda.js
Created Feb 20, 2017
Send S3 events to s slack channel via Lambda and Node.js
View s3-slack-notifier-lambda.js
'use strict';
/*
Thanks to https://gist.github.com/vgeshel/1dba698aed9e8b39a464
*/
console.log('Loading function');
const aws = require('aws-sdk');
const s3 = new aws.S3({ apiVersion: '2006-03-01' });
View keybase.md

Keybase proof

I hereby claim:

  • I am alibo on github.
  • I am alibo (https://keybase.io/alibo) on keybase.
  • I have a public key whose fingerprint is DFF3 2B75 6222 ACE7 5367 3220 7191 34AD 0F9D 1808

To claim this, I am signing this object:

@alibo
alibo / AppServiceProvider.php
Created Nov 23, 2016
Using Redis Cluster with Normal Redis instances in Laravel
View AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Redis\Database;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
@alibo
alibo / gist:9b50eca2a2609ee461ecc6c6725527f6
Created Oct 31, 2016 — forked from alexsegura/gist:9650651
Prestashop 1.6 folder permissions
View gist:9b50eca2a2609ee461ecc6c6725527f6
chmod a+w -R config/
chmod a+w -R cache/
chmod a+w -R log/
chmod a+w -R img/
chmod a+w -R mails/
chmod a+w -R modules/
chmod a+w -R themes/default-bootstrap/lang/
chmod a+w -R themes/default-bootstrap/pdf/lang/
chmod a+w -R themes/default-bootstrap/cache/
chmod a+w -R translations/
@alibo
alibo / bazaar_diff.sh
Last active Aug 18, 2016
Check sms receiver in multiple versions of cafebazaar. How to run: sh bazaar_diff.sh 7.5.0 7.5.1
View bazaar_diff.sh
#!/bin/bash
oldVersion=$1;
newVersion=$2;
smsReceiverPath="com/farsitel/bazaar/receiver/SmsAuthenticationReceiver.java";
echo "Downloading ...";
wget "https://cafebazaar.ir/static/download/Bazaar-$oldVersion.apk";
wget "https://cafebazaar.ir/static/download/Bazaar-$newVersion.apk";
echo "Decompiling ...";
@alibo
alibo / composer.json
Created Aug 16, 2016
Persian wordpress using bedrock, composer, wp-languages and wpackagist-plugin/wp-jalali
View composer.json
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "A modern WordPress stack",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
@alibo
alibo / CustomApplication.php
Last active Jun 19, 2016
Adjust Laravel public directory for cPanel and DirectAdmin
View CustomApplication.php
<?php
namespace App;
use Illuminate\Foundation\Application;
class CustomApplication extends Application
{
/**
* Get the path to the public / web directory.
*
You can’t perform that action at this time.