Skip to content

Instantly share code, notes, and snippets.

@SamYaple
SamYaple / clang static
Last active December 29, 2022 22:10
Fully static, no-pic, no-pie, musl+clang+llvm+lld
[sam@compy686 scripts]$ ../../working/roots/stage6/usr/bin/clang -v
clang version 15.0.5 (file:////mnt/mirror/git/github.com/llvm/llvm-project.git 154e88af7ec97d9b9f389e55d45bf07108a9a097)
Target: x86_64-unknown-linux-musl
Thread model: posix
InstalledDir: /opt/yinux/scripts/../../working/roots/stage6/usr/bin
[sam@compy686 scripts]$ echo -e '#include <stdio.h>\nint main() {printf("using stdio!\\n");return 0;}' | ../../working/roots/stage6/usr/bin/clang -x c - -lc -static -o hi -v
clang version 15.0.5 (file:////mnt/mirror/git/github.com/llvm/llvm-project.git 154e88af7ec97d9b9f389e55d45bf07108a9a097)
Target: x86_64-unknown-linux-musl
Thread model: posix
InstalledDir: /opt/yinux/scripts/../../working/roots/stage6/usr/bin
@SamYaple
SamYaple / my.cnf
Created September 30, 2022 18:20 — forked from oinume/my.cnf
my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
fn parse_hex_hash(s: &str) -> nom::IResult<&str, apt::Hash> {
let (s, bytes) = many0(parse_hex_byte)(s)?;
let hash = match bytes.len() {
16 => {
let mut md5 = [0u8; 16];
md5.copy_from_slice(&bytes[..16]);
apt::Hash::md5(md5)
}
20 => {
let mut sha1 = [0u8; 20];
[sam@compy686 ~]$ cat t.sh
#!/bin/bash
# I normally set these options (with x being only sometimes)
# In this example,none of them are useful for catching your error
#set -euxo pipefail
badfunction() {
for i in $(find /error); do
echo $i
done
@SamYaple
SamYaple / Dockerfile
Last active July 28, 2021 17:35
unifi
FROM ubuntu:bionic
SHELL ["/bin/bash", "-c"]
ARG DEBIAN_FRONTEND="noninteractive"
RUN set -eux; \
echo "deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse" > /etc/apt/sources.list; \
echo "deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list; \
apt-get update; \