Skip to content

Instantly share code, notes, and snippets.

View crosstyan's full-sized avatar

Crosstyan crosstyan

View GitHub Profile
@larsch
larsch / archlinuxarm-on-nanopi-r2s.md
Created October 10, 2020 10:48
Installing Arch Linux AArch64 on the NanoPi R2S

Installing Arch Linux AArch64 on the NanoPi R2S

There is current no support for the NanoPi R2S in ArchLinuxArm, but it's possible to run it using the generic aarch64 installation.

Prepare sd-card/image

  1. Copy bootloader and uBoot from an armbian image using for the NanoPi R2S using dd (sectors 32 to 32767) everything before the partition, except the partition table).
  2. Create an ext4 partition on /dev/mmcblk0p1 at offset of 32768 sectors (16384 KiB):
Device         Boot Start      End  Sectors  Size Id Type
@arifsuhan
arifsuhan / colab_host_webserver.md
Last active July 19, 2024 16:45
A general way to run Web Applications on Google Colab

Run Web Application on Google Colab

Port Selection

Port Command
Unused Port import portpicker
port = portpicker.pick_unused_port()
Or
Custom Port port = 8000
Custom Port port = 8000 port = 8000
@lawrenceching
lawrenceching / install-frp-as-systemd-service.sh
Last active March 4, 2025 15:38
Install frp as systemd service
#!/bin/bash
# Update on 2024/05/29
# 1. use wget to fetch latest frp version when curl was not installed
# 2. Remind users that frp will be run in non-root user
# 3. Add CI
#
# Update on 2024/04/13
# 1. Improved OS compatibility: try wget and then curl for downloading files.
#
# Update on 2024/01/26
@kiennq
kiennq / build_emacs.sh
Last active January 29, 2023 20:32
Build emacs-snapshot on Ubuntu 18.04
git clone --single-branch --depth=1 https://github.com/emacs-mirror/emacs.git
cd emacs/
sudo apt install -y autoconf make gcc texinfo libxpm-dev \
libjpeg-dev libgif-dev libtiff-dev libpng-dev libgnutls28-dev \
libncurses5-dev libjansson-dev libharfbuzz-dev
./autogen.sh
./configure --with-json --with-modules --with-harfbuzz --with-compress-install \
--with-threads --with-included-regex --with-zlib --with-cairo --without-rsvg\
--without-sound --without-imagemagick --without-toolkit-scroll-bars \
--without-gpm --without-dbus --without-makeinfo --without-pop \
@goll
goll / README.md
Last active March 24, 2025 06:19
Docker nftables configuration for Debian 10
@cwpearson
cwpearson / install-cmake.sh
Last active March 2, 2025 18:44
install CMake from source
set -eu
set -x
# create a `cmake` directory and extract cmake into there
# build cmake in there, and install to prefix
PREFIX=$HOME/software/cmake-3.17.0-rc3
wget -SL https://github.com/Kitware/CMake/releases/download/v3.17.0-rc3/cmake-3.17.0-rc3.tar.gz
mkdir -p cmake-3.17.0-rc3.src

Windows 10 - Using Git Bash With TMUX

Why Not Use WSL?

I tried the WSL and it isn't quite seamless enough for me. I ran in to problems when editing in VSCode and having watchers on my files (ng serve, dotnet watch run, etc.). In addition, I kept running in to problems that only manifest themselves when running in WSL. For example, this issue with doing production builds and the terser plugin has made many a developer rage-quit on using WSL. Just figuring out that it was an issue with the WSL took a lot of time.

That terser plugin issue was never resolved and I ended up having to keep a git bash window open in addition to my WSL console window so I could do production builds. To make matters worse, my npm packages were platform-dependent so I couldn't use the same project folder. So, my procedure was: commit whatever changes to test branch, push to repo, git pull on my "windows" project folder, and do a production build there

This is a bit of a thought exercise. I doubt it’s perfect and I’m hoping for opinions and corrections with the goal of a well reasoned practical approach.

Motivation...

One way to look at type declarations in a static language is as a test which picks up potential incompatible code paths. E.g. data passed is incompatible with code.

In static languages the effort to write the test is reduced by virtue of being declared inline with the code and inference allows a few annotations to permeate - having said that we can achieve a similar results in Clojure.

Quick scan of tools at hand...

@dittmaraz
dittmaraz / mongo-cheatsheet.md
Last active March 5, 2024 19:21
MongoDB/Docker Cheatsheet

Mongo/Docker Cheatsheet

To download the latest image:

$ docker pull mongo:latest

To run a mongo container with detached mode(-p) and with ports mapped (-p 27017-27017:27017-27019) and named (--name mongodb):

$ docker run -d -p 27017-27017:27017-27019 --name mongodb mongo:latest

@raulqf
raulqf / Install_OpenCV4_CUDA12.6_CUDNN8.9.md
Last active April 10, 2025 17:27
How to install OpenCV 4.10 with CUDA 12 in Ubuntu 24.04

Install OpenCV 4.10 with CUDA 12.6 and CUDNN 8.9 in Ubuntu 24.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries: