Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I'm programer and I have wife 😄

Mochamad Arifin ndunks

💭
I'm programer and I have wife 😄
View GitHub Profile
@ndunks
ndunks / Dockerfile
Created February 25, 2023 06:08
Docker with X Graphical browser chrome
View Dockerfile
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y chromium-browser
RUN export uid=1000 gid=1000 && \
mkdir -p /home/user && \
echo "user:x:${uid}:${gid}:User,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
@ndunks
ndunks / compile-gcc11-debian.sh
Last active December 5, 2022 03:20
Build/Compile GCC 11 in debian
View compile-gcc11-debian.sh
#!/bin/bash
[ -f ~/app/gcc-11.1.0.tar.xz ] || \
wget -O ~/app/gcc-11.1.0.tar.xz http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-11.1.0/gcc-11.1.0.tar.xz
[ -d ~/app/gcc-11.1.0 ] || tar -C ~/app -xvf ~/app/gcc-11.1.0.tar.xz
apt update
apt install -y \
wget xz-utils bzip2 make autoconf gcc-multilib g++-multilib \
View tracking-reset-by-peer-kafka-zookeeper.md

Logs

2022-10-17 06:41:54,110 [myid:] - WARN  [NIOWorkerThread-1:o.a.z.s.NIOServerCnxn@380] - Close of session 0x0
java.io.IOException: Connection reset by peer
        at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
        at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
        at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
        at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:245)
        at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
View tmux.conf
set -g mouse on
# Select then right click to set clipboard
set-option -s set-clipboard off
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
View helm-kube-nfs-provisioner.sh
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
--set nfs.server=192.168.1.2 \
--set nfs.path=/kube-storage \
--set storageClass.name=nfs \
--set storageClass.defaultClass=true \
--set storageClass.provisionerName=nfs-nux-provisioner \
--set nfs.volumeName=nfs-nux \
--set nodeSelector."kubernetes\\.io/hostname"=kube-nux
View Combine Speaker Into Microphone like broadcaster
# Get input list: pacmd list-sources
# Get output list: pacmd list-sinks
load-module module-null-sink sink_name=michrophone sink_properties=device.description=michrophone
load-module module-loopback source=alsa_input.pci-0000_00_1f.3.analog-stereo sink=michrophone latency_msec=1
load-module module-combine-sink sink_name=combined sink_properties=device.description=combined slaves=michrophone,alsa_output.usb-1130_USB_AUDIO-00.analog-stereo
View JS & CSS ClickMe Prank!.js
(function(){
var _ = $('\x74\x64\x2e\x64\x74\x72\x2d\x63\x6f\x6e\x74\x72\x6f\x6c')
_ = _ && _.filter((i, v) => v.innerHTML.match(/\x4d\x6f\x63\x68\x61\x6d\x61\x64\x20\x41\x72\x69\x66\x69\x6e/))
.parent().find('\x62\x75\x74\x74\x6f\x6e')
_ && _.on('\x6d\x6f\x75\x73\x65\x6f\x76\x65\x72', function () {
$(this)['\x63\x73\x73']({
'\x70\x6f\x73\x69\x74\x69\x6f\x6e': '\x61\x62\x73\x6f\x6c\x75\x74\x65',
'\x74\x6f\x70': (Math.random() * (23 + 77)) + '\x25',
'\x6c\x65\x66\x74': (Math.random() * (23 + 77)) + '\x25'
});
View gather-actions.md

Usefull function

// Your player object
let me = game.getMyPlayer()

// Your player id
let id = Object.entries(game.players).filter( ([id,o]) => o.name == game.getMyPlayer().name)[0][0]

Send Actions

View ascii-line-pattern.sh
#!/bin/bash
DELAY=0.3
STEP=0
ART_CHARS="—\\—//"
while true; do
IDX=$(( $STEP % 4 ))
CHAR=${ART_CHARS:$IDX:1}
echo -e -n "\r"
printf "$CHAR %.0s" {1..50}
STEP=$(( $STEP + 1 ))
View install-kubernetes-alpine.sh
# Enable testing community repo
apk install containerd kubeadm kubectl cni-plugins
service machine-id start
rc-update add machine-id boot
kubeadm init --pod-network-cidr=10.244.0.0/16 --control-plane-endpoint=kubemaster.local
# I use Alpine v3.15, need downgrade cni-plugins on v3.14 that have /usr/libexec/flannel
apk add cni-plugins=0.9.1-r2