Skip to content

Instantly share code, notes, and snippets.

View iAklis's full-sized avatar
🎯
Focusing on Cloud Security

Aklis iAklis

🎯
Focusing on Cloud Security
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@proudlygeek
proudlygeek / nfs-tunnel.md
Last active June 17, 2024 01:38
Mount NFS Folder via SSH Tunnel

1. Install NFS on Server

Install the required packages (Ubuntu 12.04):

apt-get install nfs-kernel-server portmap

2. Share NFS Folder

Open the exports file:

vim /etc/exports
@staltz
staltz / introrx.md
Last active July 26, 2024 04:24
The introduction to Reactive Programming you've been missing
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@arfon
arfon / big_query_examples.md
Last active September 19, 2022 13:00
BigQuery Examples for blog post

How many times shouldn't it happen...

-- https://news.ycombinator.com/item?id=11396045

SELECT count(*)
FROM (SELECT id, repo_name, path
        FROM [bigquery-public-data:github_repos.sample_files]
 ) AS F
@tonyseek
tonyseek / android-captive.sh
Last active July 4, 2024 05:27
Overrides the captive portal settings of Android in the People's Republic China mainland
#!/usr/bin/env sh
## I don't have any devices running Android OS now. These settings may have been outdated but I cannot verify it.
adb shell settings put global captive_portal_fallback_url http://g.cn/generate_204
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb shell settings put global captive_portal_other_fallback_urls http://www.qualcomm.cn/generate_204
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active July 1, 2024 21:55
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@extremecoders-re
extremecoders-re / qemu-networking.md
Last active July 8, 2024 13:24
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@jackyyf
jackyyf / wireguard.if-post-down
Created July 30, 2018 11:40
ifupdown helper for wireguard
#!/bin/bash -e
#
# wireguard helper script
#
IP=/sbin/ip
if [ "$IF_WG_CONF" -o "$IF_WG_PRIVATE_KEY" ]
then
$IP link del $IFACE
@anatol
anatol / qemucheatsheet
Created December 30, 2018 02:52
Install Arch in QEMU and run KTSAN
https://medium.com/@clem.boin/creating-a-minimal-kernel-development-setup-using-qemu-and-archlinux-987896954d84
# Install Arch system
qemu-image -f qcow2 kernel-dev-archlinux.img 4G
wget http://mirrors.edge.kernel.org/archlinux/iso/2018.12.01/archlinux-2018.12.01-x86_64.iso
# Note that ping does not work here
qemu-system-x86_64 -cdrom archlinux-2018.12.01-x86_64.iso -boot order=d -drive file=kernel-dev-archlinux.img,format=qcow2 -m 2G -enable-kvm -cpu host -smp 8 -net user,hostfwd=tcp::10022-:22 -net nic