Skip to content

Instantly share code, notes, and snippets.

@xyzkab
xyzkab / debian-things.md
Last active April 6, 2018 10:07
Things i'd ussually do after debian fresh install

Debian Things

Things i'd ussually do after debian fresh install

Disable unnecessary services

/etc/init.d/exim4 stop
/etc/init.d/rpcbind stop
update-rc.d -f exim4 remove
update-rc.d -f rpcbind remove

OpenSSH Config

@xyzkab
xyzkab / npm-module-install-locally.md
Last active April 6, 2018 09:55
Install NPM module locally/regular-user

Install NPM module locally/regular-user

cat > .npmrc
prefix=~/.npm-global
echo 'export PATH=$PATH:~/.npm-global/bin'
source .profile
npm config get prefix # make sure it set to /home/youruser/.npm-global
npm install -g <package-name>
@xyzkab
xyzkab / aws-ec2-ami-modsecurity-setup.md
Last active April 4, 2024 15:48
Setup ModSecurity in AWS EC2 AMI

Setup ModSecurity in AWS EC2 AMI

Download dependencies

We need 3 rpm packages

rpms/bison-3.0.4-3.fc23.x86_64.rpm
rpms/yajl-2.1.0-4.fc23.x86_64.rpm
rpms/yajl-devel-2.1.0-4.fc23.x86_64.rpm

Install depedencies

@xyzkab
xyzkab / debian-strect-grub-rescue-unknown-fs.md
Last active April 6, 2018 09:49
Debian Strecth: GRUB RESCUE UNKNOWN FILESYSTEM

Debian Strecth: GRUB RESCUE UNKNOWN FILESYSTEM

  • I encountered this problem in latest debian Strecth after a damn Windows 10 auto-update
    grub-rescue: unknown filesystem.
    the original on how to fix is here https://askubuntu.com/a/834631

Step-by-step

  • boot debian jessie/strecth live-cd to usb/dvd
  • mount /dev/sdaX /mnt # X is where our debian partition installed
  • for i in /sys /proc /run /dev; do mount --bind "$i" "/mnt/$i"; done
  • mount /dev/sdaX /mnt/boot/efi/ # X is where our windows 10 boot efi partition installed
@xyzkab
xyzkab / debian-jessie-install-zap-jenkins.md
Last active April 6, 2018 09:46
Debian Jessie: Install ZAP + Jenkins

Debian Jessie: Install ZAP + Jenkins

  • Disable suggested,recommends pkg
    cat > /etc/apt/apt.conf
    APT::Install-Recommends "0";
    APT::Install-Suggests "0";
    
  • Install apt-https,git,tcpdump,htop
    apt-get update
    
@xyzkab
xyzkab / sublist3r-domain-output-validator
Last active December 6, 2017 11:50
sublist3r-domain-output-validator
#!/bin/bash
#
# simple script get and parse output from sublist3r and get the addresses
# will only print sub domain target that exist
#
# sample output below
: '
Bing: sub1.targetdomain.com
Baidu: sub2.targetdomain.com
DNSdumpster: sub3.targetdomain.com
@xyzkab
xyzkab / iptables-rule-exist
Created December 27, 2017 10:26
A quick find if your rule in iptables is already added/not, assume if you have a lot of rules in your iptables
#!/bin/bash
#
# well people must be wonder, why?
# for me it's necessary if you have a lot of rules in your iptables and/combine with other command
# ps: this will only work if you use `comment` module. eg; iptables -t nat -A OUTPUT -m comment --comment
# well for what is worth maybe its just to give you an idea lolz
#
mode=$1
rule=$2
@xyzkab
xyzkab / setup-eyewitness-debian9.md
Last active July 7, 2020 11:58
Setup EyeWitness Debian Stretch

Setup EyeWitness Debian Stretch

apt-get install bzip2 build-essential autoconf libffi-dev libssl-dev libxml2-dev libtool pkg-config -y
./setup.sh
@xyzkab
xyzkab / docker-cli-reminder.md
Last active April 6, 2018 06:48
Just some docker cli reminder

Just some docker cli reminder

  • Because we hooman seems to forget stuff a lot
    this is just a notes for reminder of docker command line i use

  • When you need to run a container on privileged mode
    docker run --name l33tcnt --hostname l33tcnt -it --privileged debian:stable /bin/bash -l

  • When you need to assign more than one bridge to your container, let say you want a container to be able to
    communicate with your host private network at eth1

@xyzkab
xyzkab / upgrade-wheezy-to-jessie.md
Last active April 12, 2018 14:52
Upgrade Wheezy to Jessie

Upgrade Wheezy to Jessie

  • Update,upgrade
    apt-get update
    apt-get upgrade
    apt-get dist-upgrade
    
  • Edit /etc/apt/sources.lst rename wheezy to jessie
    sed -i 's/wheezy/jessie/g' /etc/apt/sources.list