Skip to content

Instantly share code, notes, and snippets.

View jimlinntu's full-sized avatar
🎯
Focusing

Jim Lin jimlinntu

🎯
Focusing
View GitHub Profile
@htr3n
htr3n / macos-ramdisk.md
Last active May 1, 2024 10:16
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@lcf87
lcf87 / TFDebug.md
Last active June 9, 2023 19:44
Debugging the TensorFlow internals

If you want to be able to debug CUDA kernels, this isn't for you

There are tons and tons of tutorials teaching you how to debug the TensorFlow Python APIs, which is good. But there is nearly zero converage anywhere on how to debug the internals of TensorFlow. By internals I mean everything under the Python layer, i.e. the C and C++ runtime library.

Here I'll show you how to setup the environment to debug, and how to use gdb to see under the hood of TensorFlow. But before we start, I have to mention this open source book. It covered so many internal workings of TensorFlow and is definitely worth reading. But sadly it doesn't have an official English version. You can go to the issue page and there's a thread mentioning a Google translated version. I still find it useful, despite kinda hard to read.

Let's get down to it.

Compiling

@plembo
plembo / tigervnconubuntu.md
Last active January 26, 2024 16:21
Install tigervnc on Ubuntu

NOTE: Given its current state, I've given up on tigervnc and now rely on "ssh -X" to execute remote gui apps. As a result I won't be updating this gist any more, but will leave it up as a reference for others.

Installing TigerVNC on Ubuntu 18.04 LTS

This is for Ubuntu 18.04 LTS. TigerVNC is a remote desktop session server and viewer solution sponsored by Red Hat that is still in active development. While I recently tested under Ubuntu 19.10, I have no plans to test non-LTS versions in the future.

There are packages for TigerVNC in the repositories of the major distributions, but the latest versions for Ubuntu are broken. My workaround is to use the latest stable version from the TigerVNC project Github release page, where generic binaries for 32 and 64-bit Linux are distributed as tarballs (dmg and exe installers for Mac and Windows are also available).

NOTE: A key file is missing from the latest offici

@dayvsonlima
dayvsonlima / readme.md
Created March 15, 2018 20:56 — forked from romuloctba/readme.md
Install Adobe Photoshop CS6 on Wine (Ubuntu, Elementary OS, Linux Mint)

Step 1. Install the Wine Team Ubuntu PPA

First start by installing Wine btw it's a utility to install windows apps in linux :

open the Terminal and :

   sudo add-apt-repository ppa:ubuntu-wine/ppa     
   sudo apt-get update && sudo apt-get upgrade
   sudo apt-get install wine1.7 winetricks
@awni
awni / ctc_decoder.py
Last active April 18, 2024 19:14
Example CTC Decoder in Python
"""
Author: Awni Hannun
This is an example CTC decoder written in Python. The code is
intended to be a simple example and is not designed to be
especially efficient.
The algorithm is a prefix beam search for a model trained
with the CTC loss function.
@ot32em
ot32em / VM 增大術.md
Last active April 3, 2019 11:23
將你的 Virtual Box 上的 vdi,在 Linux/LVM 的架構下,擴充本來 8GB 不夠用的大小。
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active February 29, 2024 16:29
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@miglen
miglen / linux-networking-tools.md
Last active April 23, 2024 11:39
Linux networking tools

List of Linux networking tools

netstat (ss)

Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options. Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r.

Sample output:

Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4 0 0 127.0.0.1.62132 127.0.0.1.http ESTABLISHED
@mindcont
mindcont / Ubuntu 14.04 64bit + Caffe + CUDA 7.5 + Intel MKL 配置说明.md
Last active May 21, 2019 07:45
Ubuntu 14.04 64bit + Caffe + CUDA 7.5 + Intel MKL 配置说明

Ubuntu 14.04 64bit + Caffe + CUDA 7.5 + Intel MKL 配置说明

本步骤经笔者亲身实践,集百家所长,能实现Caffe在NVIDIA GPU下进行计算。

1. 安装开发所需的依赖包

安装开发所需要的一些基本包

sudo apt-get install build-essential  # basic requirement
sudo apt-get install vim cmake git    # tools
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler libatlas-base-dev #required by caffe
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward