Skip to content

Instantly share code, notes, and snippets.

@warecrash
warecrash / makekali.sh
Last active March 10, 2025 21:20
Convert Debian to Kali
apt update
apt -y install wget gnupg dirmngr
wget -q -O - https://archive.kali.org/archive-key.asc | gpg --import
gpg --keyserver hkp://keys.gnupg.net --recv-key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6
echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" >> /etc/apt/sources.list
gpg -a --export ED444FF07D8D0BF6 | sudo apt-key add -
apt update
apt -y upgrade
apt -y dist-upgrade
apt -y autoremove --purge
@vassvik
vassvik / file.go
Created September 25, 2017 00:41
`using` in Odin
// Odin has a powerful keyword called `using`,
// which is similar to the `using` keyword in other languages like C++,
// but also a lot more versatile and powerful in Odin.
// The simplest case, that is similar to C++'s usage: it makes the names of an import name visible
// in function scope. Be careful, as this might call name collision.
fmt.println("This is a new line");
using fmt;
println("This is a new line, without fmt.");
@vassvik
vassvik / file.go
Last active December 5, 2024 15:35
Odin polymoprhic procedures and parametric types
// Odin has support for explicit and implicit polymorphic procedures and parametric types
// An explicit polymorphic procedure has the type passed as a parameter,
// while an implicit polymorphic procedure infers the type from the arguments
// a typical use-case for an explicit polymorphic procedure can be found in core/_preload.odin:
new :: proc(T: type) -> ^T {
ptr := cast(^T)alloc(size_of(T), align_of(T));
ptr^ = T{};
return ptr;
}
@vassvik
vassvik / gist:0a08ce59b678a77579db9392df983306
Last active September 25, 2017 08:14
Odin vector types and bulk operations
// Vectors are similar to arrays, but they are allow for bulk operations to all of its elements.
// Thet are meant to map to hardware level vector instructions but they can be any arbitrary length.
// Vector types only allow numeric and logical types (integers, floats, complex numbers, booleans).
// A vector type is composed as: `[vector size]T`.
// Almost all operators that work on the base type also work on the vector type.
// Exceptions are comparisons for bool vectors, shifts are for integer vectors.
fmt.println("complex operations");
c1 := [vector 2]complex64{1.0 + 3.14i, 3.0 - 5.0i};
@Tetralux
Tetralux / odin.bat
Last active June 11, 2023 15:56
A helper for compiling code with Odin on Windows
@ECHO OFF
:: Path to Odin executable
SET ODINPATH="C:\odin\odin.exe"
:: Path to the Microsoft 'vcvarsall.bat' file.
:: This sets the required environment vars and makes cl.exe and link.exe available in PATH.
SET VCVARSPATH="C:\Program Files (x86)\Microsoft Visual Studio\VC\Auxiliary\Build\vcvarsall.bat"
:: Only run the MSVC batch file the first time we
Start GDB and execute the following commands:
catch syscall ptrace
commands 1
set ($eax) = 0
continue
end
Then, run the app and voilá! you can debug your program :)
@andrewrk
andrewrk / 3let.py
Created February 15, 2016 03:27
origin of the zig programming language name. https://github.com/andrewrk/zig/
import string
import random
vowels = "aoeuiy"
def m():
c1 = vowels[random.randint(0,len(vowels)-1)]
c2 = string.ascii_lowercase[random.randint(0,len(string.ascii_lowercase)-1)]
c3 = string.ascii_lowercase[random.randint(0,len(string.ascii_lowercase)-1)]
print('z' + c1 + c2 + c3)
m()
@lopezjurip
lopezjurip / README.md
Last active April 5, 2017 08:23
Ionic2 publish Android app | sign .apk step

Go to the output .apk directory:

cd /Users/patriciolopez/Repositories/almapp/uc-courses-mobile/platforms/android/build/outputs/apk/

Put your release.keystore in that folder, if you don't have one (change ALIAS):

keytool -genkey -v -keystore release.keystore -alias ALIAS -keyalg RSA -keysize 2048 -validity 10000
@nickfloyd
nickfloyd / windbg_memory.txt
Last active January 20, 2025 09:57
windbg commands for finding memory leaks
From:
http://blogs.msdn.com/b/paullou/archive/2011/06/28/debugging-managed-code-memory-leak-with-memory-dump-using-windbg.aspx
#Set symbols File >> Symbol File path
SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
.reload
.loadby sos clr or .loadby sos mscorwks!
anonymous
anonymous / template.py
Created November 19, 2013 19:30
Template for cooperative strategy in robotgames
class Game:
def __init__(self, data, player_id):
self.player_id = player_id
self.update(data)
def update(self, data):
self.turn = data['turn']
self.robots = data['robots']
self.onNewTurn()
pass