Skip to content

Instantly share code, notes, and snippets.

View yus-ham's full-sized avatar
🌴
On vacation

Yusup Hambali yus-ham

🌴
On vacation
View GitHub Profile
<?php
class xxx {
// To convert path string into multi-dimensional array compatible for jstree jquery plugin
public function getAllPermissions() {
$perms = [
'usupha/repos',
'usupha/repos/new',
'usupha/projects',
'usupha/stars',

kemungkinan error karena shutdown computer yang dipaksa

untuk fixing

  • backup (move/rename) file ibdata1 yang ada di folder (MYSQL install)/data
  • hapus semua file (bukan folder) yang ada di folder (MYSQL install)/data
  • logout and login computer
  • sudo service mysql start
  • sudo service mysql stop
  • akan ada file ibdata1 yang baru setelah servis mysql di-start, timpa file tsb dengan ibdata1 backup
  • sudo service mysql start lagi
pkexec chmod 777 /var/run/postgresql
/usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main
xfce4-terminal -e "/usr/lib/postgresql/10/bin/pg_ctl status -D /var/lib/postgresql/10/main" --hold
@yus-ham
yus-ham / MultiPartFromStrings.php
Created August 24, 2019 13:05 — forked from iansltx/MultiPartFromStrings.php
Multipart file uploads in PHP from strings
<?php
/**
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile
* type). You can use php://temp to get around this for one file, but if you want to upload
* multiple files then you've got a bit more work.
*
* This function manually constructs the multipart request body from strings and injects it
* into the supplied curl handle, with no need to touch the file system.
  1. Install from source (recommended)

Please download the source packages from Releases or:

git clone https://github.com/swoole/swoole-src.git
cd swoole-src
git pull
git checkout v4.x.x -f

Compile and install at the source folder:

@yus-ham
yus-ham / svelte-template-syntax.md
Last active January 23, 2022 19:16
update: cc445839e3172 - jan 14
sudo add-apt-repository ppa:xapienz/curl34
sudo apt-get update
Ref
- https://launchpad.net/~xapienz/+archive/ubuntu/curl34
- https://www.ngemu.com/threads/ubuntu-bionic-libcurl-so-4-curl_openssl_3-not-found.204577/#post-2716097
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
const tls = require("tls");
const net = require("net");
var DeviceId = "b98c4fba-bfc5-4538-99f3-2a0859283947";
var SessionToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEifQ.eyJkZXZpY2UiOnsiaWQiOiJiOThjNGZiYS1iZmM1LTQ1MzgtOTlmMy0yYTA4NTkyODM5NDcifSwic2Vzc2lvbiI6eyJwbGF5ZXJJZCI6InJvZjRfX2NrYmh2M3Z2YTAwNXI4Z2xtY3RrZWdzdjEiLCJleHRyYSI6eyJwbGF0Zm9ybSI6IkFuZHJvaWQiLCJwcm9maWxlIjoiM181X2ZiYW5kX1BBQkVRNFZpbGxhZ2VFbmQifX0sImlhdCI6MTYxNjQ5NDM5MywiZXhwIjoxNjE2NTUxOTkzfQ.mWIqfbDFmzo0WjLOBh1dyDg9l-DonKoVEt6EFJ1ZyVY";
var UserId = "rof4__ckbhv3vva005r8glmctkegsv1";
// var TriplePromotion = "3f2e02554ead75a6e0461112cd17265e9b20a09cf201932509891f68bbe4025c";
// var item_code = "com.moonactive.cm.softcurrency.pack.V292.16";
// var offer_index = "3";
@yus-ham
yus-ham / ci-github.php
Last active October 21, 2023 13:22
Auto pull by webhooks
<?php
$CI_SECRET = 'xxxxx';
$BASE_DIR = '/var/www/html/';
$_SERVER['REQUEST_METHOD'] === 'POST' OR die(header('HTTP/1.1 405').'#METHOD_NOT_ALLOWED');
$data = file_get_contents('php://input');
$sign = substr($_SERVER['HTTP_X_HUB_SIGNATURE_256'] ??null, 7) OR die(header('HTTP/1.1 400').'#SIGNATURE');