Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
## 2010-06-25 | |
## (c) Felix Andrews <[email protected]> | |
## GPL-2 | |
## If 'which' is given it should be a logical matrix specifying bold cells. | |
## Otherwise: in each column or row with numeric data, the maximum or minimum | |
## value is set bold; 'max' can have entries for each column/row, NA means skip. | |
## Examples: | |
## library(xtable) |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
#this script can never fail | |
#i use it in the fish_config | |
#call it with start_agent | |
setenv SSH_ENV $HOME/.ssh/environment | |
function start_agent | |
if [ -n "$SSH_AGENT_PID" ] | |
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null |
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
#!/bin/bash | |
#hasselhoff attack taken to a new level | |
#@angrykoala | |
DIR=/home/$(whoami)/hasselhoff.jpg | |
MESSAGE="you have been hasselhoffed" | |
IMAGE_URL=http://www.ljpaez.es/imagen/hasselhoff.jpg | |
wget $IMAGE_URL -q | |
mv ./hasselhoff.jpg $DIR | |
gsettings set org.gnome.desktop.background picture-uri file://$DIR |
{-# LANGUAGE OverloadedStrings #-} | |
import Text.Pandoc.JSON | |
import System.Directory | |
import System.FilePath ((</>)) | |
import qualified Data.Hash.MD5 as MD5 | |
import qualified Data.Text as T | |
import System.IO.Temp | |
import System.Process | |
import Control.Monad (unless) |
This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:
lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)
A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly.
In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers.
This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa
in the command-line.