Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guiambros
guiambros / Dockerfile
Created December 17, 2017 03:14
Vizdoom Dockerfile
FROM ubuntu:17.04
WORKDIR /root
ARG CONDA_VERSION=Anaconda3-4.4.0-Linux-x86_64.sh
ARG CONDA_PATH=/opt/conda
ARG USER=vizdoom
# Install standard dev packages
RUN apt-get update && apt-get install -y \
build-essential \
bzip2 \
@merlinmann
merlinmann / better.md
Created February 19, 2010 17:16
Original version of Merlin Mann's Better. See http://www.merlinmann.com/better

open mic nite

Politics, celebrity gossip, business headlines, tech punditry, odd news, and user-generated content.

These are the chew toys that have made me sad and tired and cynical.

Each, in its own way, contributes to the imperative that we constantly expand our portfolio of shallow but strongly-held opinions about nearly everything. Then we're supposed to post something about it. Somewhere.

From businesses we've never heard of, to countries we've never visited, to infants who've had the random misfortune to be born into a family that's on TV -- it's all grist for obvious jokes and shortsighted commentary that, for at least a few minutes, helps both the maker and the consumer feel a little less bored, a little less vulnerable, and a little less disconnected. For a minute, anyway, it makes us feel more alive. Does me, anyway.

@akaanirban
akaanirban / gist:621e63237e63bb169126b537d7a1d979
Last active March 22, 2022 00:40
Install pyTorch in Raspberry Pi 4 (or any other)

Edit 04/11/2021: This gist is quite old now. The current version of PyTorch is 1.8.1, which is miles ahead of version 1.0.1 that I was trying to install when I wrote this gist. Therefore some of the instructions may not apply, or some dependencies may have changed or bugs taken care of. I do not currently have a Raspberry Pi to verify unfortunately. Please proceed with caution. Further, there are may others who have shared their fixes, and direct links to their wheels down in the comments. Cheers !

Install the prerequisites (the last one for numpy):

sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-yaml libatlas-base-dev

Increase the swap size:

  • Stop the swap : sudo dphys-swapfile swapoff
  • Modify the size of the swap by editing as root the following file : /etc/dphys-swapfile. Modify the valiable CONF_SWAPSIZE and change its value to CONF_SWAPSIZE=2048
@HenryJia
HenryJia / pid_cartpole.py
Last active July 15, 2022 17:34
Solving OpenAI's Cartpole with a very simple PID controller in 35 lines
import numpy as np
import gym
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
env = gym.make('CartPole-v1')
desired_state = np.array([0, 0, 0, 0])
desired_mask = np.array([0, 0, 1, 0])
@jvsoest
jvsoest / disableUSBC-PD.sh
Last active March 8, 2023 00:04
Disable USB-C PD on NUC10i5(FNH) to reduce CPU load
# 2020-11-9: Solved in recent Ubuntu updates, not needed anymore, only for historical purposes available.
#
# Script to disable USB-C PD controller with nuc10
# See: https://community.intel.com/t5/Intel-NUCs/NUC10i3-IRQ-problem/td-p/669863?profile.language=it
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1883511
processActive=$(pgrep -l irq/65-i2c-INT3 | wc -l)
if [ "$processActive" -gt "0" ]; then
echo "stopping USB-C PD controller"
@robey
robey / apple1-rom.txt
Last active May 22, 2023 03:49
apple 1 ROM disassembly
;
; the "monitor ROM" of an apple 1 fit in one page (256 bytes).
;
; this is my attempt to take the disassembled code, give names to the
; variables and routines, and try to document how it worked.
;
;
; an apple 1 had 8KB of RAM (more, if you hacked on the motherboard), and a
; peripheral chip that drove the keyboard and video. the video was run by a
; side processor that could treat the display as an append-only terminal that
@janeczku
janeczku / 00-cloud-config.yml
Last active June 10, 2023 15:10
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
#!/usr/bin/python
## License: CC0
## Author: Marco Goetze
## Web: http://solariz.de
## Version: 1.2
## DIZ:
## Little Helper Script for Linux to make my KeePass Copy and Paste cooperate again with
## Chrome Browser.
## You need to have the latest keepass version and XSEL installed.
## Tested with: