Skip to content

Instantly share code, notes, and snippets.

@elkuno213
elkuno213 / FindEigen3.cmake
Created May 2, 2024 13:21
Some CMake modules
# Hints:
# - set Eigen3_ROOT to the installation prefix of Eigen3.
# - append the installation prefix of Eigen3 to CMAKE_PREFIX_PATH.
# Results:
# - Eigen3_FOUND
# - Eigen3::Eigen
# - Eigen3_INCLUDE_DIRS
# - Eigen3_VERSION
find_path(Eigen3_INCLUDE_DIR
@elkuno213
elkuno213 / install.sh
Created April 6, 2024 14:00
Install LLVM on Ubuntu
#!/bin/sh
# Print usage information
print_usage() {
echo "Usage: $0 [llvm-version]"
echo "Installs LLVM with the specified version."
echo "If no version is provided, it defaults to version 16."
}
# Check for the number of arguments
@elkuno213
elkuno213 / install.sh
Last active April 6, 2024 13:03
Install VSCode on Ubuntu
#!/bin/sh
# Update and install prerequisites
sudo apt update
sudo apt -y install curl gpg
# Add ppa key
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
@elkuno213
elkuno213 / install.sh
Last active April 6, 2024 04:58
Install docker on Ubuntu
#!/bin/sh
# Setup apt's repository.
# -----------------------
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get -y install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
@elkuno213
elkuno213 / install.sh
Last active April 6, 2024 04:56
Install zsh and oh-my-zsh via script
#!/bin/sh
script_dir=$(dirname "$0")
$script_dir/zsh-in-docker.sh \
-t gnzh \
-p git \
-p https://github.com/zsh-users/zsh-autosuggestions \
-p https://github.com/zsh-users/zsh-syntax-highlighting
@elkuno213
elkuno213 / README.md
Last active April 6, 2024 04:52
TigerVNC remote setup in Ubuntu

TigerVNC server

# 1. Type 2 times password to access.
# 2. Type 'n' for view-only password
git clone https://gist.github.com/4eb921b320c7a8c53ba72ec24e0b48b3.git /tmp/vnc-remote-setup
sudo chmod +x /tmp/vnc-remote-setup/install_tigervnc_server.sh
/tmp/vnc-remote-setup/install_tigervnc_server.sh
sudo rm -rf /tmp/vnc-remote-setup
@elkuno213
elkuno213 / genetic.py
Created April 2, 2020 19:43 — forked from bellbind/genetic.py
[python]Genetic Algorithm example
"""Genetic Algorithmn Implementation
see:
http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php
"""
import random
class GeneticAlgorithm(object):
def __init__(self, genetics):
self.genetics = genetics
pass