Skip to content

Instantly share code, notes, and snippets.

View frett27's full-sized avatar

Patrice Freydiere frett27

View GitHub Profile
@frett27
frett27 / gist:afc33df2f54c1cf10e85e7980f2a8f9b
Last active October 16, 2020 11:35
Install llvm dependencies ubuntu 20
#!/bin/bash
apt-get install \
cmake \
liblld-10-dev \
clang-10 \
clang-format-10 \
clang-tools-10 \
clangd-10 \
libc++-10-dev:amd64 \
when having X11 application run into snap sandbox,
run export XAUTHORITY=$HOME/.Xauthority
to allow forwarding X11
@frett27
frett27 / async server
Last active April 26, 2020 07:44
Zig run sub process linux, async zig socket server
const std = @import("std");
pub const io_mode = .evented;
pub fn main() anyerror!void {
const allocator = std.heap.page_allocator; // TODO use a more appropriate allocator
var server = std.net.StreamServer.init(.{});
defer server.deinit();
rsync --progress -avhe ssh /usr/local/ XXX.XXX.XXX.XXX:/BackUp/usr/local/
# https://github.com/jklmnn/gnat-llvm-xtensa
# https://github.com/tomekw/ada-gnat
#
git clone https://github.com/tomekw/ada-gnat
cd ada-gnat
docker build -t ada-gnat .
@frett27
frett27 / ARMonQEMUforDebianUbuntu.md
Created December 15, 2019 15:26 — forked from luk6xff/ARMonQEMUforDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@frett27
frett27 / vm.sh
Created March 6, 2019 12:14 — forked from afair/vm.sh
VM command to wrap virtualbox vboxmanage commands
#!/bin/bash
# install - http://www.unixmen.com/install-oracle-virtualbox-and-manage-it-using-phpvirtualbox-on-ubuntu-15-10-headless-server/
# remoting - http://www.virtualbox.org/manual/ch07.html
# vboxmanage - http://www.virtualbox.org/manual/ch08.html
if [ "$1" = "" ]; then
echo "Usage: vm command vmname args..."
exit
fi
g++ -c -fdump-ada-spec -C /usr/include/time.h
more on https://www.adacore.com/gems/gem-59
Starting with the situation you have:
cd dpkg-1.18.15
patch -p1 < ../d-m-h-verbose-version-check.patch
will apply the patch. Before building, add a NMU changelog entry (this will avoid having your patched version of dpkg overwritten by apt & co., but will ensure your version is upgraded to the next dpkg release when that's available):
dch -n "Apply d-m-h fix from #844701."
This will rename the current directory (because dpkg is a native package), so you need to change directories again:
cd ../dpkg-1.18.15+nmu1
@frett27
frett27 / docker-cleanup-resources.md
Created August 2, 2018 07:10 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm