Skip to content

Instantly share code, notes, and snippets.

View ekojs's full-sized avatar
🏠
Working from home

Eko Junaidi Salam ekojs

🏠
Working from home
View GitHub Profile
@ekojs
ekojs / ga_decrypt.sh
Created December 25, 2023 12:31 — forked from yibe/ga_decrypt.sh
#!/usr/bin/env bash
# Based on https://git-annex.branchable.com/tips/Decrypting_files_in_special_remotes_without_git-annex/
usage() {
echo "Usage: ga_decrypt.sh -r REMOTE [-k SYMLINK] [-d FILE...]"
echo ""
echo " Either lookups up key on REMOTE for annex file linked with SYMLINK"
echo " or decrypts FILE encrypted for REMOTE."
echo ""
@ekojs
ekojs / apache.yaml
Last active April 4, 2023 23:38
k8s
apiVersion: v1
kind: Service
metadata:
name: apache
labels:
app: apache
spec:
ports:
- port: 80
name: theweb
@ekojs
ekojs / compile.php
Last active January 6, 2023 18:45
Create phar file
<?php
// this compile.php file above of html folder
try {
$pharFile = 'app.phar';
// clean up
if (file_exists($pharFile)){
unlink($pharFile);
}
if (file_exists($pharFile . '.gz')){
@ekojs
ekojs / readme.md
Created April 22, 2022 08:40
Convert Centos 8 to Centos 8 Stream

Convert Centos 8 to Centos 8 Stream

dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos
dnf distro-sync
@ekojs
ekojs / parse.php
Created March 26, 2022 00:08
Decoding base64 and decompress zlib
<?php
$encode = "eJxUj1+L2zAQxL/KMs9KWUmWddZbrklB5zgJsa9QSh8ENjkR1ylu+o/S717WoS0FvWhmZ+e3P8GMoMvCW1cUzhfeO+1dWSmwRsCYvw6rz5fLyrDR2pgCCmwQYNiYFduVdsQclieWvVt+sQoyNrgquEqsAgFtZKuZLRRk+7rttnXcbw7yZwS8IV1VllibypFUEDPrkj21ke4xye3aI/3NUn3Yt93puW4jNev9Jp6izAnkU/qWqMsfv8yiWIT3eEpjmggKp2vqCR8UtIBpR02ah9tSKsNOxOKf6KFg/r9g2bd+GTM1qf+R6DH3aTpTPaSXMaeJuuEy5QstjVBoct+PA22/fxrmG+WJFoLtdM7TMMx5Oi80AvMABemvr7dEjcTPUCilro3HuIPC6/g27mTe/4GAwn21qA8IeHzeRDqe4rvD/qCo7V5BoUKAdd6yscyutCyX/PodAAD///W3fj8=.eJwAAAH//g+YOGEP9nUcBU7XFSBm4TYcB6Jpqj5aK1XS2U8GHZ1GuTo19S02kynBeZbktw14ETaOjSJKYfArIAGwBO80SgQ/Yi6BAROWnbquuf8Ai5V8QEiLDudQHzv3JwouT1dKr2x+htYcQgETR4uHWy6ZGKhLZ5iSslURyR6Y0AlkRx2rWjrIFqrP1b8Dyqh5t9smTpmthNijz3GiWnt7hsVK94zsGDtWsfDOWQ0D71FSP/zXzk1QB4xZBHKEza1L5lJVVem3u2pM9mi79bdgfAPHNLPgIkmlcV5K3cQGgrX8tbXBimo/s7lp9uJrG6kW6b5pPYT7PDeWNUfcKdO+on3KX84BAAD//7Lsdqk=";
$str = preg_replace('/[^A-Za-z0-9\+\/=]/i', '', $encode);
$decode = zlib_decode(base64_decode($str));
$json = json_decode($decode);
//echo $decode.PHP_EOL;
print_r($json
@ekojs
ekojs / keybase.md
Created March 17, 2022 09:12
Keybase proof

Keybase proof

I hereby claim:

  • I am ekojs on github.
  • I am ekojs (https://keybase.io/ekojs) on keybase.
  • I have a public key ASCpckRCH8_TV2NiQlFYMEaidchp5SmC3IiNkwRqru5IlAo

To claim this, I am signing this object:

@ekojs
ekojs / check_audit.sh
Last active January 22, 2022 09:56
Compile custom semodule for selinux policy
#!/bin/bash
for x in $(ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR -i | grep -w comm | sed 's/.*comm/comm/g;s/comm=\(\w\+\).*/\1/g' | sort -u);do ausearch -c "$x" --raw | audit2allow -w;done
@ekojs
ekojs / luks2.md
Last active October 21, 2023 04:30
Setup LVM Thin in Centos 8

Setup LUKS 2 in RHEL 9.2

Format block device

cryptsetup luksFormat /dev/sdX

Open Device

cryptsetup open /dev/sdX sdx_crypt
@ekojs
ekojs / compile.sh
Last active April 4, 2021 01:55
shellcode assembly
nasm -f elf64 -o shell64.o shell64.asm
ld -o shell64 shell64.o
objdump -d shell64.o | grep -E "[0-9a-f]+:\s+[0-9a-f].*" | sed 's/.*:\s*//g;s/\s\{2,\}.*$//g' | sed 's/\(\w\{2\}\)/\\x\1/g;s/\s//g' | perl -p -e 's/\n//g'
@ekojs
ekojs / docker-compose.yml
Created October 17, 2020 12:38
My Kong Setup
version: '3.7'
networks:
kong-net:
external: false
services:
kong-migrations:
image: kong
command: "kong migrations bootstrap && kong migrations up && kong migrations finish"