Skip to content

Instantly share code, notes, and snippets.

View 23Pstars's full-sized avatar

Ahmad Zafrullah 23Pstars

View GitHub Profile
@23Pstars
23Pstars / hosts
Created March 26, 2023 10:14 — forked from abdilahrf/hosts
Blokir hostname INDIHOM* ke localhost kita biar kapok, untuk linux tambahin di file /etc/hosts & windows /System32/drivers/etc/hosts
# INDIHOM*
127.0.0.1 x-tags.net
127.0.0.1 a01.uadexchange.com
127.0.0.1 cdn.uzone.id
127.0.0.1 cdn3.uzone.id
127.0.0.1 cfs.uzone.id
127.0.0.1 csf.uzone.id
127.0.0.1 d01.notifa.info
127.0.0.1 d31qbv1cthcecs.cloudfront.net
127.0.0.1 d5nxst8fruw4z.cloudfront.net
@23Pstars
23Pstars / index.php
Created October 6, 2021 08:03
simple s3 php script upload
<?php
include 'S3.php';
define('S3_ENDPOINT', 's3.amazonaws.com');
define('S3_BUCKET', 'bucket');
define('S3_DIR', 'path/to/dir');
define('S3_KEY', '*****');
define('S3_SECRET', '*****');
#!/bin/bash
DB_HOST={{db_name}}
DB_NAME={{db_name}}
DB_USER={{db_user}}
DB_PASS={{db_pass}}
S3_PATH=path/to/app/
FILE_NAME=mysql-$(date +%Y%m%d-%H_%M_%S)
echo "dump db..."
mysqldump -h $DB_HOST -u $DB_USER -p$DB_PASS $DB_NAME > $FILE_NAME.sql
echo "compress..."
@23Pstars
23Pstars / php7err.conf
Last active October 5, 2021 08:25
apache logs to telegram notifications
type=Single
ptype=RegExp
pattern=\[php7\:
desc=$0
action=shellcmd /path/to/dir/tg-send.sh "$0"
@23Pstars
23Pstars / sia-telegram.php
Last active October 5, 2021 08:26
Code snippet of core functionalities inside Bot Telegram-SIA services
<?php
# Fungsi load tombol pada keyboard sebagai menu
# masing-masing untuk dosen dan mahasiswa
public static $_services = [
self::_dosen => [
self::_akademik,
self::_daftar_kelas,
self::_reset_password,
self::_presensi_kehadiran,
@23Pstars
23Pstars / do_space.sh
Created May 7, 2019 07:26
Dump and backup MySQL database to S3 server
#!/bin/bash
#
# LRsoft Corp.
# https://lrsoft.co.id
#
# Author: Zaf
# Date: 10/22/18
# Time: 10:01 AM
# install https://s3tools.org/download first
@23Pstars
23Pstars / update.sh
Last active November 16, 2021 09:46
city-fan.org repo CentOS 7 for cURL
rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel7.noarch.rpm
rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
yum -y --enablerepo=city-fan.org update curl
@23Pstars
23Pstars / httpd.conf
Last active May 19, 2017 19:54
Apache httpd.conf minimal (macOS Sierra)
# Load new configuration using `apachectl restart`
# Validation run `apachectl configtest`
# Local
Listen 80
ServerName localhost
ServerAdmin zaf@elektro08.com
# Optional Modules
LoadModule authn_file_module libexec/apache2/mod_authn_file.so
<?php
set_time_limit( 0 );
require_once( 'cURL.php' );
require_once( 'GitHub.php' );
require_once( 'Bitbucket.php' );
/** Bitbucket credentials */
$username = 'User';