This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| _RETRY_COUNT=0 | |
| while true | |
| do | |
| ("$@") && break | |
| let _RETRY_COUNT=${_RETRY_COUNT}+1 | |
| echo -e "\e[1;31mRetry ${_RETRY_COUNT}...\e[0m" | |
| sleep 0.5; echo -ne '\a'; sleep 0.5; echo -ne '\a'; sleep 0.5; echo -ne '\a'; sleep 0.5 | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ | |
| /* [ Created with wxMaxima version 13.04.2 ] */ | |
| /* [wxMaxima: input start ] */ | |
| FlashRot:matrix( | |
| [ cos(rotY)*cos(rotZ), cos(rotY)*sin(rotZ), sin(rotY), 0], | |
| [-sin(rotZ), cos(rotZ), 0, 0], | |
| [-sin(rotY)*cos(rotZ), -sin(rotY)*sin(rotZ), cos(rotY), 0 ], | |
| [trX, trY, 0, 1]); | |
| /* [wxMaxima: input end ] */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| outpemfile="${1:-cert.pem}" | |
| tmpprefix="/tmp/gensslcert-$$" | |
| openssl genrsa -des3 -out "$tmpprefix.key" 2048 | |
| openssl req -new -key "$tmpprefix.key" -out "$tmpprefix.csr" | |
| openssl rsa -in "$tmpprefix.key" -out "$outpemfile" | |
| rm -f "$tmpprefix.key" | |
| openssl x509 -req -days 365 -in "$tmpprefix.csr" -signkey "$outpemfile" -out "$tmpprefix.crt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Geordi memory dumper | |
| geordi: {size_t s=0x400000;printf("0x%08zx: ",s);for(size_t p=s;p<s+64;p++){unsigned char c=*(const unsigned char *)p;printf((c>31&&c<127)?"%c":"\\x%02x",c);}} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* usbreset -- send a USB port reset to a USB device */ | |
| /* http://askubuntu.com/a/661/299378 */ | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <errno.h> | |
| #include <sys/ioctl.h> | |
| #include <linux/usbdevice_fs.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| '''Dump the command line passed to it''' | |
| import sys | |
| def quote_argv(argv): | |
| for i in argv: | |
| apos = ' ' in i or '\\' in i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To record both mic and other audio input sources we need to add a named output sink. See: | |
| # http://www.linuxquestions.org/questions/linux-software-2/alsa-and-pulseaudio-recording-multiple-input-devices-877614/ | |
| # http://www.youtube.com/watch?v=oJADNOY615Y&feature=player_embedded | |
| # Add this to your /etc/pulse/default.pa file | |
| load-module module-null-sink sink_name=stream | |
| load-module module-loopback latency_msec=5 sink=stream | |
| load-module module-loopback latency_msec=5 sink=stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="zh-cn"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <style> | |
| p { | |
| width: 600px; | |
| font-family: "Source Han Sans SC Normal"; | |
| font-weight: 300; | |
| font-size: 18px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Personal reminder | |
| # Do not use it unless you know what it means! | |
| parec --rate=48000 --format=float32le -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | \ | |
| ffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i :0 \ | |
| -f f32le -ar 48k -ac 2 -i - \ | |
| -vf setpts='(RTCTIME-RTCSTART)/(TB*1000000)' \ | |
| -b:v 512k -c:v libx264 -profile:v main -pix_fmt yuv420p -level:v 4.1 -tune:v zerolatency -preset:v ultrafast -g:v 25 \ | |
| -b:a 96k -c:a libfdk_aac -profile:a aac_he \ | |
| -f flv -vsync passthrough rtmp://localhost/live |