Skip to content

Instantly share code, notes, and snippets.

View agungsijawir's full-sized avatar
😊
Slow but sure coming back to live

Agung Andika agungsijawir

😊
Slow but sure coming back to live
View GitHub Profile
@agungsijawir
agungsijawir / shell_access_telegram.md
Created November 3, 2019 13:01
Allow sending message to telegram bot when someone access shell

Shell Script that sends alerts to Telegram Bot

  1. Create your bot with help from BotFather. Make sure it has inline_mode enabled.

  2. Create shell script on /etc/pam.d directory named ssh_access.sh.

    touch /etc/pam.d/ssh_access.sh chmod 0700 /etc/pam.d/ssh_access.sh chown root:root /etc/pam.d/ssh_access.sh

# mysql --version
mysql Ver 15.1 Distrib 10.1.35-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
# mysql -uroot -p
MariaDB [(none)]> create schema `test_ai`;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> use `test_ai`;
Database changed
solrconfig.xml
<?php
use yii\db\Migration;
class m170211_100226_initProvinsi extends Migration
{
public function up()
{
$this->createTable('provinsi', [
'id' => $this->string(128)->notNull(),
@agungsijawir
agungsijawir / vhost_workshop.conf
Created February 10, 2017 17:14
vhost_workshop.conf
# ************************************
# Vhost template for workshop yii2
# stack: apache2.4 + php7.0-fpm
# ************************************
<VirtualHost *:80>
## domain name, use for development only
## map this domain and this machine IP to your 'hosts' file
ServerName workshop.dev
@agungsijawir
agungsijawir / ctimer.php
Created August 31, 2016 08:59 — forked from petskratt/.gitignore
Group file change times by inode ctime
<?php
/**
* Group file change times by inode ctime
* User: petskratt ([email protected])
* Date: 23.08.2016
* Time: 13:245
* v.1.2
* - fixed json creation
* - added possibility to read from json files
* - this "quick hack" is becoming quite messy - but it works and saves lives, so refactoring can wait
@agungsijawir
agungsijawir / MyAsset.php
Last active May 11, 2016 10:55
Sample use gentella theme admin on yii2
<?php
namespace app\assets;
use yii\web\AssetBundle;
class MyAsset extends AssetBundle
{
public $sourcePath = '@bower/gentelella';
public $css = [
/**
* Ini diambil dari folder vendors
*/
@agungsijawir
agungsijawir / audio-out.md
Created March 23, 2016 16:54
Patch AppleHDA.kext for T430 (El Capitan)

Patch AppleHDA.kext ke bagian: /AppleHDA.kext/Contents/PlugIns/AppleHDAHardwareConfigDriver.kext/Contents/Info.plist

	<dict>
		<key>HDA Hardware Config Resource</key>
		<dict>
			<key>CFBundleIdentifier</key>
			<string>com.apple.driver.AppleHDAHardwareConfigDriver</string>
			<key>HDAConfigDefault</key>
@agungsijawir
agungsijawir / city.sql
Created March 17, 2016 00:09
Dump Table Provinsi, Kota, Kecamatan di Indonesia - MySQL
-- TokoOnlie Data Kota -terelasi dengan data provinsi- di Indonesia
-- Last Updated 01 Pebruari 2016
-- Operasi ini akan menghapus (drop) table yang lama dan menggantinya dengan yang baru.
SET NAMES utf8;
SET time_zone = '+07:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `kota`;
@agungsijawir
agungsijawir / galera-custer-create.md
Created February 1, 2016 13:51
Create MariaDB Galera Cluster

Create MariaDB Galera Cluster

For server hardware, each node requires at a minimum:

  • 1GHz single core CPU
  • 512MB RAM
  • 100 Mbps network connectivity
  • LinuxOS (Ubuntu 14.04 x64 preferred)

Installation