Skip to content

Instantly share code, notes, and snippets.

View lshaf's full-sized avatar
💭
Working

L Shaf lshaf

💭
Working
View GitHub Profile
@lshaf
lshaf / guide.md
Created October 12, 2023 05:24
PHP Installation Scripts

Install Ondrej Repository

sudo add-apt-repository ppa:ondrej/php

Installation Script

Save code below as install-php then do command chmod +x install-php.
For installation you can simply done install-php 7.3. You can change the version whicever you want!

@lshaf
lshaf / form-post.js
Last active March 30, 2021 11:08
send POST with form using JSON data
function formPost(url, data, callback) {
let form = $("<form>", {
method: 'POST',
action: url,
target: "_blank"
});
function generateInput(iData, namePrefix) {
if (namePrefix === undefined) namePrefix = "";
for ([keyData, vData] of Object.entries(iData)) {
@lshaf
lshaf / artisan.init.d
Created February 23, 2021 01:53
artisan queue worker
#! /bin/sh
### BEGIN INIT INFO
# Provides: lspos-worker
# Required-Start: redis-server
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Artisan queue worker
# Description: PHP Artisan queue worker from laravel that works on redis
@lshaf
lshaf / index.html
Last active February 22, 2021 13:56
Pi Zero Dashboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zero Shaf</title>
<style>
body, html {
height: 100%;
@lshaf
lshaf / faq.md
Last active September 26, 2024 09:38
biolbe note and collabolator

FAQ (Frequently Asked Question)

  1. Kak, tadinya auto mf saya jalan, tapi kenapa tiba-tiba enggak? udah 1 jam lebih ga ada mf yang ke kirim.
    • Kemungkinannya adalah sebagai berikut
      • Akun twitter anda lagi limit
      • App kalian tidak sengaja kena revoke
      • App kalian di blok oleh twitter
    • Yang harus kalian lakukan
      • Cek limit akun twitter kalian
  • Cek status auto menfess kalian dengan cara kirim dm /info @akunbase ke @bot_mf
@lshaf
lshaf / mysql.lua
Last active August 13, 2020 11:50
Custom mysql lua script for vernemq.
-- /usr/share/vernemq/lua/auth/mysql.lua
-- Only replace the function
function auth_on_register(reg)
if reg.username ~= nil and reg.password ~= nil then
raw_client_id = reg.client_id
form_client_id = raw_client_id:gsub("#", "%")
results = mysql.execute(pool,
[[SELECT publish_acl, subscribe_acl
FROM vmq_auth_acl
@lshaf
lshaf / wordwrap.cs
Created June 16, 2020 14:25
Word wrap in C Sharp
using System;
using System.Collections;
using System.Linq;
public class Program
{
class StringHelper
{
public static ArrayList WordWrap(string text, int maxLength = 86)
{
RewriteEngine on
# Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines.
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
@lshaf
lshaf / updateKey.sh
Created March 15, 2020 05:55
update apt key when it's error or expired
sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
@lshaf
lshaf / terminal-setting.json
Created October 14, 2019 13:55
Terminal Windows (Preview) Setting
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{2c4de342-38b7-51cf-b940-2309a097f518}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[