Skip to content

Instantly share code, notes, and snippets.

@wjdp
wjdp / gitmirror.py
Created January 31, 2023 21:51
Simple script to maintain a local copy of your GitHub repos
#!/usr/bin/env python3
import requests
from requests.auth import HTTPBasicAuth
import click
from tqdm import tqdm
from pathlib import Path
import os.path
import subprocess
from glob import glob
@younesbelkada
younesbelkada / shard_weights.py
Last active July 6, 2024 15:31
A script to shard any model on the Hugging Face format
import torch
import os
import json
import argparse
parser = argparse.ArgumentParser(description='Sharding Hugging Face models')
parser.add_argument('--sharding_factor', default=4, type=int, help='Sharding factor - aka how many shards to create')
parser.add_argument('--source_model_path', default="t5-v1_1-xl", type=str, help='Relative path to the source model folder')
parser.add_argument('--sharded_model_path', default="t5-v1_1-xl-sharded", type=str, help='Relative path to the target sharded model folder')
args = parser.parse_args()

Blotter File Format - v7

The Blotter File Format, successor to the format known as ".tung files", is a system for storing the components and wires of a Logic World world. It is used for both full world saves as well as subassemblies, but there are slight differences between the two.

File types

  • World files:
    • Represent a full, playable world space
    • May have zero or more root components at different positions/rotations in the world
  • Use .logicworld file extension
@ryands
ryands / docker-compose.yml
Created August 9, 2018 00:19
gitlab-ce omnibus docker behind a local nginx reverse proxy (letsencrypt ssl termination at local nginx)
version: '3'
services:
gitlab:
image: gitlab/gitlab-ce:latest
hostname: gitlab.example.com
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com/'
nginx['listen_port'] = 80
nginx['listen_https'] = false
@udkyo
udkyo / Dockerfile
Last active May 1, 2024 12:51
Basic container for X11 forwarding goodness
FROM ubuntu
RUN apt update \
&& apt install -y firefox \
openssh-server \
xauth \
&& mkdir /var/run/sshd \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \
server {
access_log /var/log/nginx/gitlab_gitlab.log;
error_log /var/log/nginx/gitlab_gitlab.error.log;
listen 80;
server_name git.domain.de;
return 301 https://$server_name$request_uri; # enforce https
}
server {
version: '2'
services:
postgresql:
image: sameersbn/postgresql:9.4-22
restart: always
environment:
- DB_USER=gitlab
- DB_PASS=geheim
- DB_NAME=gitlabhq_production
Go to: chrome://settings/searchEngines
Add a new search engine with the following settings
Gif | Gif | https://www.google.com/search?q=%s&tbm=isch&tbs=itp:animated
Type gif in the address bar press TAB and enter your search query
@moschlar
moschlar / README.md
Last active March 25, 2019 05:01
Build and install ShareLaTeX in Ubuntu 14.04 LTS

Since the official ShareLaTeX documentation is primarily written with Ubuntu 12.04 LTS in mind, I tried to re-build the provided .deb from scratch using Ubuntu 14.04 TLS with the least amount of non-standard or non-packaged software.

Here are all the steps that were required (with sudo since Ubuntu doesn't want you to be root).

First, install lots of packages - note that no additional repositories are required! (Dependencies):

$ sudo apt-get update
$ sudo apt-get install git build-essential curl python-software-properties zlib1g-dev zip unzip
$ sudo apt-get install ruby-dev
$ sudo apt-get install nodejs npm
apt-get install python2.7-dev python2.7
apt-get build-dep gdb
apt-get source gdb
sed -i -E "s|python3|/usr/bin/python2.7|" debian/rules
dpkg-buildpackage -uc -us -j8
dpkg-install ../*.deb