I hereby claim:
- I am kfei on github.
- I am kfei (https://keybase.io/kfei) on keybase.
- I have a public key ASBqABPMn4hnjXBn2PWO0agEIH4aBQoD7rqrykOtLG576go
To claim this, I am signing this object:
#!/bin/bash | |
docker run -it --rm --privileged --net host \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |
-v $PWD:$HOME/workspace \ | |
-v $HOME/.Xauthority:$HOME/.Xauthority \ | |
-e HOME=$HOME \ | |
-e DISPLAY=$DISPLAY \ | |
--entrypoint /usr/sbin/ffmpeg \ | |
kfei/ffmpeg $* |
# File Transfer model #3 | |
# | |
# In which the client requests each chunk individually, using | |
# command pipelining to give us a credit-based flow control. | |
import os | |
import sys | |
from threading import Thread | |
import zmq |
# Use ffmpeg to decode input video (GIF in this case) | |
ffmpeg -i input.gif decode/%d.png | |
# Use ImageMagick to crop, format: (W)x(H)+(W_SFHIT)+(H_SHIFT) | |
# Note the {from..to..skip} usage of Bash | |
convert decoded/{1..759..5}.png -crop 315x172+20+40 resized/%d.png | |
# An resize option | |
# convert decoded/{1..759..5}.png -crop 315x172+20+40 -resize 30% resized/%d.png |
I hereby claim:
To claim this, I am signing this object:
import java.io.IOException; | |
import java.io.InputStream; | |
import com.jcraft.jsch.Channel; | |
import com.jcraft.jsch.ChannelExec; | |
import com.jcraft.jsch.JSch; | |
import com.jcraft.jsch.JSchException; | |
import com.jcraft.jsch.Session; | |
public class Exec { |
def get_interface_name | |
interfaces = {} | |
puts 'Valid network interfaces detected are:' | |
interfaces_with_mac = `ifconfig -a | grep -i hwaddr | awk '{ if( match($1, /^eth/) ) {print $1, $5} }'`.lines.map(&:chomp) | |
interfaces_with_mac.each_with_index do |x, index| | |
interfaces[index] = x.split[0] | |
puts " #{index}) #{x.split[0]} ( #{x.split[1]} )" | |
end | |
print 'Please choose an interface to configure: ' |
// With naturalWidth, naturalHeight | |
myImage.addEventListener('onload', function() { | |
console.log('My width is: ', this.naturalWidth); | |
console.log('My height is: ', this.naturalHeight); | |
}); | |
// Without naturalWidth, naturalHeight | |
function realImgDimension(img) { | |
var i = new Image(); | |
i.src = img.src; |
# Create new array | |
mdadm --zero-superblock /dev/sd{a,b} | |
mdadm -C --level 1 /dev/md1 -n 2 /dev/sda2 /dev/sdb2 | |
# Save to mdadm.conf since it will be used in initramfs for assembling arrays | |
mdadm --detail --scan >> /etc/mdadm.conf | |
# Make new file system and then migrate data | |
rsync -avxHAXS -P / /mnt/md1 |
# -*- coding: utf-8 -*- | |
# Define here the models for your scraped items | |
# | |
# See documentation in: | |
# http://doc.scrapy.org/en/latest/topics/items.html | |
import scrapy | |
(pprof) top10 | |
130ms of 130ms total ( 100%) | |
Showing top 10 nodes out of 11 (cum >= 80ms) | |
flat flat% sum% cum cum% | |
60ms 46.15% 46.15% 60ms 46.15% math.Sqrt | |
20ms 15.38% 61.54% 80ms 61.54% github.com/kfei/sshcam/img2xterm.cie94 | |
20ms 15.38% 76.92% 20ms 15.38% runtime.usleep | |
10ms 7.69% 84.62% 10ms 7.69% retake | |
10ms 7.69% 92.31% 10ms 7.69% runtime.cas64 | |
10ms 7.69% 100% 10ms 7.69% runtime.nanotime |