Skip to content

Instantly share code, notes, and snippets.

View dbrgn's full-sized avatar

Danilo Bargen dbrgn

View GitHub Profile
$ docker run python:3.4 pip install pytest-pep8
Unable to find image 'python:3.4' locally
3.4: Pulling from library/python
693502eb7dfb: Pull complete
081cd4bfd521: Pull complete
5d2dc01312f3: Pull complete
54a5f7da9a4f: Pull complete
25b1aaa33436: Pull complete
3168f1c413f2: Pull complete
7834951bf6f6: Pull complete
/* automatically generated by rust-bindgen */
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Rectangle {
pub width: ::std::os::raw::c_int,
pub height: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Rectangle() {
= note: /home/danilo/Projects/rad1o-rust/target/thumbv7em-none-eabihf/release/deps/gravitation-e8a3aecc3f3d7459.0.o: In function `ram':
gravitation.cgu-0.rs:(.text.ram+0x2ee): undefined reference to `__aeabi_ui2d'
gravitation.cgu-0.rs:(.text.ram+0x2fc): undefined reference to `__aeabi_ddiv'
gravitation.cgu-0.rs:(.text.ram+0x308): undefined reference to `__aeabi_dmul'
gravitation.cgu-0.rs:(.text.ram+0x312): undefined reference to `__aeabi_ui2d'
gravitation.cgu-0.rs:(.text.ram+0x31c): undefined reference to `__aeabi_ddiv'
gravitation.cgu-0.rs:(.text.ram+0x324): undefined reference to `__aeabi_dmul'
gravitation.cgu-0.rs:(.text.ram+0x35e): undefined reference to `__aeabi_ddiv'
gravitation.cgu-0.rs:(.text.ram+0x37e): undefined reference to `__aeabi_dsub'
gravitation.cgu-0.rs:(.text.ram+0x38a): undefined reference to `__aeabi_ddiv'
running: "arm-none-eabi-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-mthumb" "-mfloat-abi=hard" "-march=armv7e-m" "-mfpu=fpv4-sp-d16" "-fno-builtin" "-fvisibility=hidden" "-fomit-frame-pointer" "-ffreestanding" "-mthumb" "-mfloat-abi=hard" "-march=armv7e-m" "-DVISIBILITY_HIDDEN" "-o" "/home/danilo/Projects/rad1o-rust/target/thumbv7em-none-eabihf/release/build/compiler_builtins-4c275c6c6f45f16c/out/./compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins/absvdi2.o" "-c" "./compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins/absvdi2.c"
cargo:warning=In file included from /usr/lib/gcc/arm-none-eabi/6.3.0/include-fixed/syslimits.h:7:0,
cargo:warning= from /usr/lib/gcc/arm-none-eabi/6.3.0/include-fixed/limits.h:34,
cargo:warning= from ./compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins/int_lib.h:63,
cargo:warning= from ./compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins/absvdi2.c:15:
cargo:warning=/usr/lib/gcc/arm-none-eabi/6.3.0/incl
@dbrgn
dbrgn / in.ts
Last active September 7, 2021 07:58
TypeScript + async / await + throw
async function foo() {
await sleep(1000);
console.log(1);
await sleep(1000);
console.log(2);
console.log("throwing now");
if (1 == 1) {
throw "oh shitshit";
}
await sleep(1000);
@dbrgn
dbrgn / scan.sh
Last active October 9, 2021 15:20
Determine whether subdirectories containing git repos are dirty or diverged
#!/bin/bash
function git_is_dirty {
[[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "yes"
}
function git_is_diverged {
LOCAL=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "none")
REMOTE=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2> /dev/null || echo "none")
if [[ "$LOCAL" == "none" ]]; then # No commits yet
@dbrgn
dbrgn / 1_test.py
Last active February 8, 2016 12:19
Term Frequency Calculation Speed
import re
import collections
import math
import numpy as np
import lxml.etree
from lxml.html.clean import Cleaner
ITERATIONS = 2500
@dbrgn
dbrgn / block-samsung.py
Last active January 30, 2016 23:24
A small script to block Samsung IPs from a Mikrotik Router.
"""
A small script to block Samsung IPs from a Mikrotik Router.
"""
import re
import subprocess
# File containing hostnames, one per line
INPUT_FILE = 'dns-lookups.txt'
# File containing block commands
@dbrgn
dbrgn / gist:8243aaaa0a0e47eda094
Last active April 6, 2020 08:11
Mikrotik RouterOS: Block DNS lookups for names containing "samsung"
/ip firewall filter add
chain=input
action=drop
comment="deny DNS resolution containing 'samsung' from SmartTV"
protocol=udp dst-port=53
content="samsung"
src-mac-address=<smartv-mac-addr>
/ip firewall filter add
chain=forward
action=drop
@dbrgn
dbrgn / domains.txt
Last active January 30, 2016 21:02
Samsung SmartTV (2015 series) DNS Lookups
# Samsung
cdn.samsungcloudsolution.com
configprd.samsungcloudsolution.net
dpu.samsungelectronics.com
gpm.samsungqbe.com
kpu.samsungelectronics.com
lcprd2.samsungcloudsolution.net
osb.samsungqbe.com
sas.samsungcloudsolution.com