Skip to content

Instantly share code, notes, and snippets.

View andrew-ma's full-sized avatar
💭
I may be slow to respond.

Andrew Ma andrew-ma

💭
I may be slow to respond.
View GitHub Profile
@andrew-ma
andrew-ma / .screenrc
Last active August 22, 2021 21:48
Screen Config
# Automatically detach upon hangup, and not terminate processes
autodetach on
# make Detach and Re-attach without losing regions layout
layout save default
# To not see startup message
startup_message off
# Use bright colors for bold text
@andrew-ma
andrew-ma / Install Vscode on Debian
Created July 15, 2021 02:34
Install Vscode on Debian
curl -OJL "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64"
sudo dpkg -i code_*.deb
@andrew-ma
andrew-ma / Install Docker with 'apt install'
Last active October 25, 2022 05:08
Install Docker on Debian, Ubuntu, or Kali
sudo apt remove docker docker-engine docker.io containerd runc -y
sudo apt update -y
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg --yes
DEBIAN_VERSION="$(lsb_release -cs)"
if [ $? -ne 0 ]; then DEBIAN_VERSION=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d"=" -f2 | tr -d '"'); fi
if [ "$DEBIAN_VERSION" = "kali-rolling" ]; then DEBIAN_VERSION="buster"; fi
RELEASE_ID=$(cat /etc/os-release | grep '^ID=' | cut -d'=' -f2)
if [ ! "$RELEASE_ID" = 'ubuntu' ]; then RELEASE_ID='debian'; fi
ARCHITECTURE=$(dpkg --print-architecture)
@maximlt
maximlt / run_python_script_in_conda_env.bat
Last active April 1, 2024 06:23
Run a Python script in a conda environment from a batch file
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\ProgramData\Miniconda3
rem Define here the name of the environment
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active June 29, 2024 04:08
set -e, -u, -o, -x pipefail explanation
@vietdien2005
vietdien2005 / install.md
Last active November 6, 2023 15:59
Install Nagios + Nginx Centos 7
  • Install Dev Tools, PHP, Nginx
  sudo yum install nginx php php-fpm php-common gcc glibc glibc-common gd gd-devel make net-snmp unzip -y
  sudo yum groupinstall 'Development Tools' -y
  • Nginx – Nagios Configuration
  cd /etc/nginx/conf.d
  sudo vi nagios.conf
@intrd
intrd / nc_bruteforce.sh
Last active June 28, 2022 08:41
Netcat bruteforce script used in crypto100-master @ 3dsctf-2k16
#!/bin/bash
## Netcat bruteforce script used in crypto100-master @ 3dsctf-2k16
# @author intrd - http://dann.com.br/
# @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/
for letter in {A..Z} ; do
echo $letter
sleep 1
(echo "yes" & sleep 1 & echo "$letter") | nc -i1 -w5 54.175.35.248 8002
done
@noelboss
noelboss / git-deployment.md
Last active June 12, 2024 00:28
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@lastguest
lastguest / JSON_to_URLEncoded.js
Created July 10, 2014 17:47
Convert JavaScript object to x-www-form-urlencoded format
function JSON_to_URLEncoded(element,key,list){
var list = list || [];
if(typeof(element)=='object'){
for (var idx in element)
JSON_to_URLEncoded(element[idx],key?key+'['+idx+']':idx,list);
} else {
list.push(key+'='+encodeURIComponent(element));
}
return list.join('&');
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2024 08:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname