Skip to content

Instantly share code, notes, and snippets.

@victorhcm
victorhcm / README.md
Created July 7, 2024 03:29 — forked from paulgregg/README.md
Converting a gitlab export to simple git repo

Converting a gitlab export to simple git repo

Gitlab exports a tar.gz file which contains a file called project.bundle. We can convert this file into a normal git repo using the following steps:

Extract the project.bundle file

$ tar xvfz GitLabExport.gz
@victorhcm
victorhcm / readme.md
Created July 5, 2024 13:54 — forked from maxivak/readme.md
Restore repo from Gitlab bundle file

Gitlab exports repositories to tar archive which contains .bundle files.

We have repo.bundle file and we want to restore files from it.

  • create bare repo from bundle file
git clone --mirror myrepo.bundle my.git
@victorhcm
victorhcm / sbatlog.py
Last active January 22, 2022 19:09
A slurm sbatch wrapper that automatically opens the output file
#!/bin/python3
import os
import sys
import subprocess
import re
def run():
arguments = sys.argv[1:]
  1. Install CMake 3.5.2 on CentOS 7

    Download Source distributions cmake-3.5.2.tar.gz from https://cmake.org/download/
    ./bootstrap
    gmake
    sudo gmake install
    
  2. Install libgpuarray on Centos 7

@victorhcm
victorhcm / slurm_utils.sh
Last active May 2, 2019 02:47
SLURM utils. Add to your .bashrc
# =================================================
# SLURM UTILS
# =================================================
# sbatlog: runs sbatch and automatically tail -f slurm-$number.out
function sbatlog
{
result=$(command sbatch "$@")
outputid=$(echo $result | awk -F' ' '{print $NF}')
# fileout="slurm-$outputid.out" # assumes default file output name
@victorhcm
victorhcm / remux_packets.py
Created June 10, 2018 23:27
Remux packets without transcoding
import av
import numpy as np
def write_packets(filename, packets, video_stream):
container = av.open(filename, mode='w')
stream = container.add_stream(template=video_stream)
stream.options = {}
for p in packets:
if p.dts is not None:
@victorhcm
victorhcm / rainbowtable.py
Created January 29, 2018 21:18 — forked from lgommans/rainbowtable.py
A toy rainbow table script
#!/usr/bin/env python3
import sys
from hashlib import md5
from base64 import b64encode
from binascii import hexlify, unhexlify
from time import time
def reduction_function(hash, max_password_length):
@victorhcm
victorhcm / fractalnet-34.png
Last active October 30, 2017 01:12
FractalNet-34 prototxt for visualization at http://dgschwend.github.io/netscope
fractalnet-34.png
@victorhcm
victorhcm / latency.markdown
Created September 30, 2017 23:26 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@victorhcm
victorhcm / VGG_FACE_deploy_updated.prototxt
Last active October 4, 2016 09:05
Updated VGG_FACE prototxt
name: "VGG_FACE_16_layer"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 224
input_dim: 224
layer {
name: "data"
type: "Data"
top: "data"