Skip to content

Instantly share code, notes, and snippets.

@antoinebrl
antoinebrl / README.md
Last active January 23, 2025 16:27
Prepare ImageNet

Preparation of ImageNet (ILSVRC2012)

The dataset can be found on the official website if you are affiliated with a research organization. It is also available on Academic torrents.

This script extracts all the images and group them so that folders contain images that belong to the same class.

  1. Download the ILSVRC2012_img_train.tar and ILSVRC2012_img_val.tar
  2. Download the script wget https://gist.githubusercontent.com/antoinebrl/7d00d5cb6c95ef194c737392ef7e476a/raw/dc53ad5fcb69dcde2b3e0b9d6f8f99d000ead696/prepare.sh
  3. Run it ./prepare.sh
@adriancperez2
adriancperez2 / wsl2_love_openwrt.md
Created January 23, 2025 16:26 — forked from Balder1840/wsl2_love_openwrt.md
Run OpenWrt as a custom distro in WSL2 (WSL2下直接运行openwrt)

Here is an instruction to start openwrt as a custom WSL2 distro.
I didn't start it as a gateway in my local because I don't have windows 11 installed, and you know the poor network mode in windows 10 and wsl2.

Found a way to set WSL's network mode to bridged here and have successfully configured it as a gateway in my local.

But anyway, I think it should work under windows 11 and wsl2, since you can config it as bridged mode.
Have fun!

1. Prerequisites

1.1. Import openwrt's rootfs.tar.gz as a custom WSL2 distro

you can download from the official site

@sunmeat
sunmeat / gist:9977d8e5231d2bd4047d908a017b17bf
Last active January 23, 2025 16:24
quick sort example C++
#include <iostream>
using namespace std;
void quick_sort(int mass[], int start, int end)
{
int L = start, R = end;
int M = mass[(start + end) / 2];
do
@maximousblk
maximousblk / tor.md
Created September 8, 2020 06:29
A super simple guide to starting up your own Tor hidden service

Host your own Tor hidden service!

A super simple guide to spinning up a Tor hidden service. [tl;dr]

Ubuntu 20.04 LTS was used for the making of this guide.

Install Tor

you can install Tor using the following command

SC config trustedinstaller start=auto
net stop bits
net stop wuauserv
net stop msiserver
net stop cryptsvc
net stop appidsvc
Ren %Systemroot%\SoftwareDistribution SoftwareDistribution.old
Ren %Systemroot%\System32\catroot2 catroot2.old
regsvr32.exe /s atl.dll
regsvr32.exe /s urlmon.dll
@sbimochan
sbimochan / codeql-local.md
Last active January 23, 2025 16:23
Run CodeQL locally to check your codebase

Install CodeQL CLI from here

codeql database create project-ql --language=javascript
codeql pack download codeql/javascript-queries
codeql database analyze project-ql codeql/javascript-queries --format=sarifv2.1.0 --output=query-results.sarif --download
sudo pip install sarif-tools
sarif html -o venteur-ql-report/summary.html query-results.sarif

Now open the summary.html in your favorite browser

@sunmeat
sunmeat / insertion_sort.cpp
Last active January 23, 2025 16:23
insertion sort example C++
#include <iostream>
using namespace std;
int main()
{
const int size = 10;
int ar[size];
// before sort
for (int i = 0; i < size; i++)
@ilyajob05
ilyajob05 / build_install_python_3_11.sh
Last active January 23, 2025 16:22
Build and Install Python 3.11.9
wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz
tar -xvf Python-3.11.9.tgz
cd Python-3.11.9/
sudo ./configure --enable-optimizations
sudo make -j 8
sudo make altinstall
# to home dir
cd
# make venv
python3.11 -m venv venv311
@ilyajob05
ilyajob05 / init.lua
Last active January 23, 2025 16:21
Configuration file and script for install packages
--[[
Complete Neovim Configuration
Author: Community Maintained
License: MIT
--]]
-----------------------------------------------------------
-- 1. Core Settings
-----------------------------------------------------------
vim.g.mapleader = " "
@NickSeagull
NickSeagull / ubuntu-bloat-removal.sh
Last active January 23, 2025 16:20
Updated Jan 22nd, 2024 - Simple command to remove all "bloatware" from ubuntu
sudo apt-get remove \
aisleriot \
brltty \
duplicity \
empathy \
empathy-common \
example-content \
gnome-accessibility-themes \
gnome-contacts \
gnome-mahjongg \