Skip to content

Instantly share code, notes, and snippets.

View chenull's full-sized avatar
🚒
wiu wiu wiu

Sayid Munawar chenull

🚒
wiu wiu wiu
  • JogjaCamp
  • Yogyakarta, Indonesia
  • X @chenull
View GitHub Profile
@chenull
chenull / findlens.sh
Last active December 28, 2018 11:34
find matching augeas lens for a file using augtool and ag
# require ag the silver searcher installed
FILE='/var/lib/krb5kdc/kadm5.acl'; \
OIFS="$IFS"; IFS=$'\n'; \
for lens in \
$(ag --nofilename -no '^module [A-Z][A-Za-z0-9_]+ =' /usr/share/augeas/lenses/dist/ \
| grep -E '.+' \
| sed -Ee 's/module ([^=]*) =.*/\1/'); do \
_file=$(echo $FILE | grep -o '[^/]*$')
if {sudo augtool -At "$lens incl $FILE" print | grep -m 1 -A 10 ^/files/ | grep "${_file}/" }; then \
echo -e "$lens\n"; \
@chenull
chenull / badwords_kata_kotor_jorok_indonesia.py
Last active August 29, 2015 14:26
Kata kotor jorok indonesia dan luar yang umum, tapi 4 huruf saja
import re
base_char = 'ABCDEFGHJKLMNPQRSTUVWXYZ123456789'
def cek_porno(bad):
# Cek ASU
if re.match(r'[2-9]ASU', bad):
return False
# EEK
@chenull
chenull / IPaddr
Last active August 29, 2015 14:19 — forked from vincepii/IPaddr
#!/usr/gnu/bin/sh
#
# License: GNU General Public License (GPL)
# Support: linux-ha@lists.linux-ha.org
#
# This script manages IP alias IP addresses
#
# It can add an IP alias, or remove one.
#
# usage: $0 {start|stop|status|monitor|validate-all|meta-data}
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
PROMPT_DIRTRIM=3
export PS1='\[\033[01;32m\]\u\[\e[31m\]@\[\033[1;37m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \$ '
#!/bin/bash
#set -x
# vmsynchosts.sh
# Syncronize all /etc/hosts for VMWare Fusion VMs
# Copyright (c) Sayid Munawar <sayid.munawar@gmail.com>
# License: BSD
#
# Note:
# 1. link /Applications/VMware Fusion.app/Contents/Library/vmrun to /usr/local/etc/vmrun first