Skip to content

Instantly share code, notes, and snippets.

View joseluis's full-sized avatar
💭
dreamin' n workin'

José Luis Cruz joseluis

💭
dreamin' n workin'
View GitHub Profile
@goproslowyo
goproslowyo / repackage.md
Created April 3, 2022 10:32
Repackage a Package Because dpkg on Ubuntu Doesn't Known the Compression of the Member Inside

What does the problem look like?

Because of this bug the libnet1 dpkg installation fails.

$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/libnet1_1.1.6+dfsg-3.1build2_amd64.deb
dpkg-deb: error: archive '/var/cache/apt/archives/libnet1_1.1.6+dfsg-3.1build2_amd64.deb' uses unknown compression for member 'control.tar.zst', giving up
dpkg: error processing archive /var/cache/apt/archives/libnet1_1.1.6+dfsg-3.1build2_amd64.deb (--install):
 dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
@shawwn
shawwn / since2010.md
Created May 11, 2021 09:46
"What happened after 2010?"

This was a response to a Hacker News comment asking me what I've been up to since 2010. I'm posting it here since HN rejects it with "that comment is too long." I suppose that's fair, since this ended up being something of an autobiography.

--

What happened after 2010?

@Wumpf
Wumpf / cfd.md
Last active April 10, 2024 22:39
Notes on CFD
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@mitchmindtree
mitchmindtree / rust-audio-state-of-the-repos.md
Created May 29, 2019 18:44
RustAudio - State of the Repos

In Path to Rust Audio I briefly mentioned that the repos are in a variety of states of maintenance - here I'll give my own impression of the current state of each of the repositories.

ogg and lewton - active I believe both were started by est31, both seem to be actively used and worked on.

coreaudio-sys and coreaudio-rs - active I started these to add audio I/O support to CPAL a few years ago. I have since moved to Linux as my daily machine and don't often get the chance to test for them anymore, however Rhuagh has kindly taken over testing and reviews. I still try to review code when I can.

deepspeech-rs - seems active

@joseluis
joseluis / playground.rs
Last active April 13, 2019 18:48 — forked from rust-play/playground.rs
abstracting over fields with trait abuses: reddit.com/r/rust/comments/bc2w4m/announcing_rust_1340/eks8tq5/?context=3
trait Field {
type ValueType;
}
use std::marker::PhantomData as Marker;
struct X<T>(Marker<T>);
struct Y<T>(Marker<T>);
struct Z<T>(Marker<T>);
@XoroshiroNOT
XoroshiroNOT / XoroshiroNOT.c
Last active March 4, 2022 15:30
XoroshiroNOT PRNG
/*
XoroshiroNOT PRELIMINARY BETA RELEASE v0.10 (for testing only, as defects unknown to the author may exist, thus all below claims must be independently verified).
XoroshiroNOT Pseudo-Random Number Generator, © Christopher Rutz, All Rights Reserved. Contact information below.
XoroshiroNOT is an extrapolation of xoroshiro++, by S. Vigna and D. Blackman.
XoroshiroNOT may also be referred to as Xoroshiro++- or Xoroshiroppm.
XoroshiroNOT purports to improve upon their work by over-provisioning the underlying xoroshiro state by 50% and flipping the rotate/shift direction, thus providing these many features and characteristics:
1. Near-ideal pseudo randomness within a given period that is (perhaps uniquely) explicitly defined by, but greater than that inherent in, the underlying (xoroshiro) base generator randomness and period:
A. Randomness period = wordsize^2 - 1, which is easily testable with 8-bit byte and 16-bit word size versions.
B. 16-bit word, 32-bit dword and 64-bit qword versions pass TestU01 BigCr
@fenollp
fenollp / wth.txt
Created June 12, 2018 22:42
T460 stuck in boot loop? Try disabling TPM
If your thinkpad T460 is somehow stuck in a reboot cycle
* right after a storm
* even though your SSD / peripherals work fine on other laptops
* even after trying everything forums & youtube has to offer
* even after buying a non functional motherboard from Moldavia from [this guy](https://www.ebay.com/usr/goodwinflat)
* even after expecting that previous idea would work somehow
well then try disabling anything you can in your BIOS.
If you can't even get to BIOS you have bigger issues. Maybe power? Probably motherboard.
Turns out, for me, disabling the Intel Trusted execution things (TPM, TXT, ...) solved it!
@kulia
kulia / x4m300parser.py
Created February 19, 2018 18:13
Parser for streaming data from Xethru X4M300 presence sensor from Novelda.
from pymoduleconnector import ModuleConnector
from pymoduleconnector.ids import XTID_SM_STOP
from pymoduleconnector.ids import XTS_ID_APP_PRESENCE_2
from pymoduleconnector.ids import XTS_ID_PRESENCE_SINGLE
from pymoduleconnector.ids import XTS_ID_BASEBAND_IQ
from pymoduleconnector.ids import XTID_SM_RUN
import numpy as np
class StreamData: