Skip to content

Instantly share code, notes, and snippets.

View nikAizuddin's full-sized avatar
⚠️
s t a t i c

Nik Mohamad Aizuddin nikAizuddin

⚠️
s t a t i c
View GitHub Profile
@seven1m
seven1m / hello_world_llvm.cpp
Last active May 2, 2024 05:20
Simple 'hello world' example in LLVM IRBuilder
// % clang++ $(llvm-config --cxxflags --ldflags --system-libs --libs core) -o hello_world_llvm hello_world_llvm.cpp
// % ./hello_world_llvm
// hello world
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/ExecutionEngine/GenericValue.h>
#include <llvm/IR/IRBuilder.h>
#include <stdio.h>
using namespace llvm;
@ansemjo
ansemjo / container-systemd-autologin.conf
Created April 26, 2019 10:53
enable root autologin when starting a container with systemd init
# drop-in override to fix and enable autologin in rootless containers with systemd init
# e.g.:
#
# podman run --rm -it \
# -v .../container-systemd-autologin.conf:/etc/systemd/system/console-getty.service.d/override.conf:ro \
# centos:latest /usr/lib/systemd/systemd
[Service]
ExecStart=
ExecStartPre=-/usr/bin/sed -i '/pam_loginuid.so/d' /etc/pam.d/login
@lightrush
lightrush / README.md
Last active September 2, 2023 22:57
Normalize volume level with PulseAudio

Normalize volume level with PulseAudio and simultaneous output

This should work conceptually on any Linux OS with PulseAudio but these particular instructions are for Ubuntu. There are two major reasons for using simultaneous output. The first is self-evident - we can output to say a bluetooth headset and wired headphones at the same time to enable two people to watch a movie with headphones on a single computer. The second reason is a sort of a convenience for setup. We know the simultaneous sink name so the default.pa config would work without modification so long as simultaneous output is enabled. If we were to set this up without that, we'd have to customize the config with our specific device sink name. That's totally doable but personally I always setup simultaneous output. That's why I haven't described the alternative in this gist.

@narate
narate / create-hotspot.md
Last active April 15, 2024 14:22
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@croxton
croxton / SSL-certs-OSX.md
Last active March 3, 2024 18:58 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@gtt116
gtt116 / gist:e7abe1c32a46df85b7599fbc7a9f9f73
Created April 25, 2017 02:33
autossh supervisord config file
[program:autossh]
command=autossh -M0 -N
-o "ExitOnForwardFailure yes"
-o "ServerAliveInterval 15"
-o "ServerAliveCountMax 4"
-o "ControlPath none"
-o "UserKnownHostsFile=/dev/null"
-o StrictHostKeyChecking=no
-R 1234:localhost:1234
-R 4567:localhost:4567
@PatWie
PatWie / update-tensorflow.sh
Last active December 4, 2019 18:24
simple cronjob script to frequently build TensorFlow from source automatically
#!/bin/bash
# Patrick Wieschollek
# =============================================================
# UPDATE SOURCE
# =============================================================
git checkout -- .
git pull origin master
@sidorelauku
sidorelauku / install.sh
Created December 22, 2016 22:17
Install Visual Studio Code on openSUSE
curl -sSL -o code.tar.gz https://go.microsoft.com/fwlink/?LinkID=620884
sudo mkdir -p /opt/code && sudo tar zxf code.tar.gz -C /opt/code --strip-components=1
sudo ln -sf /opt/code/code /usr/local/bin
@wllhf
wllhf / VOClabelcolormap.py
Last active March 28, 2024 09:11
Python implementation of the color map function for the PASCAL VOC data set.
"""
Python implementation of the color map function for the PASCAL VOC data set.
Official Matlab version can be found in the PASCAL VOC devkit
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/index.html#devkit
"""
import numpy as np
from skimage.io import imshow
import matplotlib.pyplot as plt
def color_map(N=256, normalized=False):
@lukas-h
lukas-h / license-badges.md
Last active May 1, 2024 10:20
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)