View gist:852572c81e195b930f297dc79c3df10f
This file contains 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
alias randman='dir="/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p")' |
View build_opencv_ARM_cross
This file contains 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
This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native | |
compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen | |
to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for | |
native compiling without any issues. | |
Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing | |
that out. | |
Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5. | |
Let us use the term "build machine" for your PC where you are building opencv and "target machine" for the ARM single board computer. | |
1.Run the following commands in both machines(I think installing these in target machine only would do) to install the necessary libraries etc.(mine worked with them,so they should be enough |
View pre_commit_reject_wildcard_imports
This file contains 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/sh | |
# | |
# cp to .git/hooks | |
# chomd +x .git/hooks/pre_commit | |
# | |
# This hook checks for wildcard imports (other than kotlinx) when added to staging. | |
# TODO: add ktlint check | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' |
View size_up_tensorflow
This file contains 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
1/30/2019 | |
Python 2.7.12 (default, Nov 12 2018, 14:36:49) | |
[GCC 5.4.0 20160609] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import rglob | |
>>> rglob.lcount("/media/chris/UBNT/tensorFlowExample/tensorflow","*.py") | |
3268693 | |
>>> rglob.lcount("/media/chris/UBNT/tensorFlowExample/tensorflow","*.java") | |
245116 |
View basic_file_nano_template
This file contains 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
Add your index.html file to res/raw | |
Add dep to app gradle file: | |
dependencies { | |
implementation 'org.nanohttpd:nanohttpd-webserver:2.3.1' | |
} | |
Java class file: | |
import fi.iki.elonen.NanoHTTPD; |
View gist:78284318cbad31d7fb92f8200213cec9
This file contains 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
#create patches from author(s) into one without comments | |
#good for GPLv2 sharing | |
for c in `git log --format=format:%H --author=chris`;do git format-patch --stdout --format=format:%H --no-stat -1 $c;done | tee stuff.patch |
View bash_pic_convert
This file contains 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
for f in ./*.*;do convert -resize 1280x720 $f ./720p/$f; done |
View git_pull_sub_repos
This file contains 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
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git pull" \; |
View cli_vs_filereader
This file contains 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
//1ms but uses file cache so not updated quickly | |
try { | |
String inputLine; | |
FileReader file = new FileReader("/sys/class/power_supply/battery/current_now"); | |
BufferedReader bufferedReader = new BufferedReader(file); | |
inputLine = bufferedReader.readLine(); | |
text = inputLine; | |
bufferedReader.close(); | |
file.close(); | |
} catch (Exception e) { |
NewerOlder