Skip to content

Instantly share code, notes, and snippets.

adi leveled

Block or report user

Report or block leveled

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leveled
leveled / divide_string_half_python.py
Created Aug 9, 2019
Divide string in half in python
View divide_string_half_python.py
firstpart, secondpart = string[:len(string)//2], string[len(string)//2:]
@leveled
leveled / remap_caps_lock_escape.sh
Created Aug 3, 2019
Remap Caps Lock to Escape on Linux
View remap_caps_lock_escape.sh
setxkbmap -option ‘caps:ctrl_modifier’
xcape -e Caps_Lock=Escape
View kvm_installation.sh
root@amol-hp-elite:~ virt-install --name node-2 --vcpus=1 --memory 512 --disk path=/var/lib/libvirt/images/trusty-server-cloudimg-amd64-disk1-node2.i
mg,bus=virtio,cache=writeback --disk path=/var/lib/libvirt/images/config-drive-node2.iso,device=cdrom --graphics vnc,listen=0.0.0.0 --network bridge:v
irbr2,model=virtio --noautoconsole --os-type=linux --boot=hd
#Attaching an additional interface
virsh attach-interface --domain node-2 --type bridge --source virbr1 --model virtio --config
@leveled
leveled / kvm_networking.sh
Created Aug 3, 2019
KVM/Virt-Manager/Qemu Networking
View kvm_networking.sh
virsh net-list --all #List networks
virsh net-info default #get details about default network
brctl show
virsh net-dumpxml default #dump xml of default network
virsh net-dhcp-leases default #check VMs and IPs assigned on the network
#nat.xml - NAT Network
<network>
<name>natntw</name>
View android_paths.sh
#Android paths
PATH="/home/adi/Android/Sdk/platform-tools:$PATH"
PATH="/home/adi/Android/Sdk/tools:$PATH"
PATH="/home/adi/Android/Sdk/tools/bin:$PATH"
PATH="/home/adi/Android/Sdk/build-tools/29.0.1:$PATH"
ANDROID_SDK_ROOT="/home/adi/Android/Sdk/tools"
NDK="/home/adi/Android/Sdk/ndk-bundle"
@leveled
leveled / pip_issues.sh
Created Aug 3, 2019
Fix pip issues on ubuntu
View pip_issues.sh
sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
View x86_x86_64_calling_conventions.txt
x86 function calls:
parameters pushed last in first
x86 syscalls
eax -syscall number
ebx through ebp are used for parameters
return value is in eax
x86_64 syscalls
The kernel interface uses %rdi, %rsi, %rdx, %r10, %r8 and %r9.
@leveled
leveled / dhcp_server_dnsmasq.sh
Created Aug 2, 2019
Setup DHCP server with dnsmasq
View dhcp_server_dnsmasq.sh
sudo apt-get install dnsmasq
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
# /etc/dnsmasq.d/vnet
dhcp-range=10.10.10.3,10.10.10.100,12h
dhcp-option=option:dns-server,10.10.10.2
sudo systemctl start dnsmasq
sudo systemctl enable dnsmasq
View lxd_cheatsheet.sh
#basic creation start up of conatiners
lxc launch ubuntu:18.04 first
lxc list
lxc exec first -- /bin/bash
lxc file pull first/etc/hosts .
lxc file push hosts first/tmp/
lxc stop first
lxc delete first
#list remote images
View proxmox_cheatsheet.sh
#Linux Containers
pct create 999 local:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz
pveam update
pveam available
pveam available --section system
pveam download local debian-8.0-standard_8.0-1_amd64.tar.gz
You can’t perform that action at this time.