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 8000Each 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| ;;;; SHA-1 and SHA-2 implementations. | |
| ;;;; Uses R7RS bytevector and byte I/O interfaces. | |
| ;;;; Requires SRFIs 1, 26, 43, and 60. | |
| ;;; Auxiliary definitions to avoid having to use giant tables of constants. | |
| (define primes80 '(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 | |
| 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 | |
| 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 | |
| 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 |
I am using the built in GSM (UMTS) modem of my Thinkpad X1 extensively because I am often in places with flaky internet connections. I connect through the standard Network Manager on Ubuntu and everything works fine. There was one major annoyance though. Every time I wanted to top up the SIM balance or book a new package, I needed a phone to send and receive USSD codes. So I took some time to figure out how to do it from the shell. I wrote this down as a help for others and a reminder for myself. Without further ado...
First intsall gammu and picocom.
➜ ~ sudo apt-get install -y gammu picocom| var {utils: Cu, classes: Cc, instances: Ci, results: Cr} = Components | |
| Cu.import('resource://gre/modules/Services.jsm'); | |
| var myobserve = function(aSubject, aTopic, aData) { | |
| var httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel); | |
| var isXHR; | |
| try { | |
| var callbacks = httpChannel.notificationCallbacks; | |
| var xhr = callbacks ? callbacks.getInterface(Ci.nsIXMLHttpRequest) : null; |
| # This is my compton configuration after a quick cleanup. (It's still none too organized; sorry about that.) | |
| # With this file at ~/.config/compton.conf, I can run compton without any arguments (just plain `compton`). | |
| # | |
| # In the hopes that explaining my software and hardware environment might be helpful to you: | |
| # | |
| # I use this configuration on Ubuntu 15.10 (and have used it on previous releases); I am currently using the 352.63 ("long-lived | |
| # branch") NVIDIA binary drivers, installed from the Ubuntu software repositories. I use fluxbox as my window manager; most of | |
| # the other components of my desktop environment are borrowed from Xfce. | |
| # | |
| # My workstation at home has an i7-4930K and a GTX 970 in it, which are together more than enough to drive several 4K displays |
| defmodule Blank do | |
| @moduledoc """ | |
| Tools around checking and handling undefined or blank data. | |
| """ | |
| @doc """ | |
| Returns `true` if data is considered blank/empty. | |
| """ | |
| def blank?(data) do | |
| Blank.Protocol.blank?(data) |
| /* ext2scan: | |
| * Scans an input stream, sector by sector, for something that looks like an ext{2,3,4} partition. | |
| * It does this by looking for a magic WORD, 0xEF53, at a known offset into the sector. | |
| * For random data, this will occur by chance around once per 32MB of data, so we also | |
| * check whether the first two sectors are all zeros, which is commonly true for ext partitions. | |
| * | |
| * Compile with: | |
| * gcc ./ext2scan.c -o ./ext2scan | |
| * | |
| * Example usage: |
| # make sure chromaprint source is in $PWD/chromaprint | |
| # after run use $PWD/chromaprint/libchromaprint.min.js | |
| # does not use --bind and set NO_DYNAMIC_EXECUTION to generate code | |
| # that don't use eval | |
| CC = emcc | |
| CXX = em++ | |
| CFLAGS = -O2 -DUSE_KISSFFT=1 -Isrc -Ivendor/kissfft | |
| CXXFLAGS = -O2 -std=c++11 -DUSE_KISSFFT=1 -Isrc -Ivendor/kissfft |