Skip to content

Instantly share code, notes, and snippets.

@joselitosn
joselitosn / graph-opencc.lua
Last active Jan 19, 2018
Attempt to create a text graph using unicode braille - not finished
View graph-opencc.lua
local class = require 'middleclass'
Node = class("Node")
function Node:initialize(data)
self.next = nil
self.data = nil
end
View minecraft-redflux-generation.md

The Big Table of RedFlux Generation

This document is intended as a way to report the current RedFlux generation values from various mods and suggest alterations to keep integrations between then.

Right now there are a few energy sytems used by different Minecraft mods, but currently RedFlux is the most commonly used.

My main focus is liquid fuels, but solid fuels are accounted for comparison purposes.

Contributions are very much welcome.

@joselitosn
joselitosn / minecraft-mods.md
Last active May 20, 2019
Compilation of my most used Minecraft mods
View minecraft-mods.md
@joselitosn
joselitosn / bsploader
Created Nov 27, 2017
Library to retrieve information on GoldSource BSP file format files
View bsploader
#!/usr/bin/env python3
"""
BSPLoader
"""
__author__ = "Vinicios R Portella"
__version__ = "0.1.0"
__license__ = "BSD"
from enum import Enum, auto
View lxc-vxlan.md

LXC-with-VXLAN-tunneling

Seting up

  • Creating 2 KVM virtual machines (host1 and host2, each one them has kernel: 3.19.0-64-generic) and attached them in the network 192.168.10.0/24

  • Install LXC on each virtual machine

  • Interface of host1: 192.168.10.156

  • Interface of host2: 192.168.10.222

@joselitosn
joselitosn / pysmb.py
Created Mar 16, 2016
Python SMB Example
View pysmb.py
from smb.SMBConnection import SMBConnection
userID = 'user'
password = 'password'
client_machine_name = 'localpcname'
server_name = 'servername'
server_ip = '0.0.0.0'
domain_name = 'domainname'
@joselitosn
joselitosn / ubuntu-trusty-preseed.seed
Created Sep 22, 2015 — forked from moonwitch/ubuntu-trusty-preseed.seed
Preseed for Trusty Thrall - 14.04 LTS
View ubuntu-trusty-preseed.seed
########################################################################
#### Custom Preseed Amlin Europe using Ubiquity
### By Kelly Crabbé for Amlin Europe
### Tested on Ubuntu Trusty Thral 14.04 LTS
####################################################################
# General
####################################################################
# Once installation is complete, automatically power off.
View ffi_ex.py
from cffi import FFI
ffi = FFI()
ffi.set_unicode(True)
ffi.cdef('''
HANDLE FindFirstVolume(LPTSTR lpszVolumeName, DWORD cchBufferLength);
BOOL FindVolumeClose(HANDLE hFindVolume);
''')
lib = ffi.verify('''
View beep.c
#include <stdio.h>
#include <windows.h>
int main(int argc, char *argv[]) {
Beep(392, 350); Sleep(100);
Beep(392, 350); Sleep(100);
Beep(392, 350); Sleep(100);
Beep(311.1, 250); Sleep(100);
Beep(466.2, 25); Sleep(100);
Beep(392, 350); Sleep(100);
@joselitosn
joselitosn / dhcp-rogue.py
Created Oct 3, 2014
Detects rogue DHCP servers
View dhcp-rogue.py
#!/usr/bin/env python
from scapy.all import *
fam, hw = get_if_raw_hwaddr(conf.iface)
# Define a callback function for when DHCP packets are received
def dhcp_callback(pkt):
# Check if the DHCP packet is a DHCP offer
if DHCP in pkt and pkt[DHCP].options[0][1] == 2:
print 'DHCP offer received from %s (%s)' % (pkt[IP].src, pkt[Ether].src)