Skip to content

Instantly share code, notes, and snippets.

@bluesmilery
bluesmilery / create_virtual_env.sh
Last active May 23, 2021 05:36
[create_virtual_env] Used to create a Anaconda virtual environment for CUDA and TensorFlow. If you want to use this shell script, please read the blog. https://bluesmilery.github.io/blogs/a687003b/
#!/bin/bash
# Used to create a Anaconda virtual environment for CUDA and TensorFlow.
# If you want to use this shell script, please read the blog.
# https://bluesmilery.github.io/blogs/a687003b/
echo ""
echo "This script is used to create a Anaconda virtual environment for CUDA and TensorFlow."
echo ""
read -p "Enter the name of Anaconda virtual environment: " ENV_NAME
@snowwalf
snowwalf / video.api.md
Last active April 16, 2019 14:38
视频鉴黄/鉴暴恐/暴恐检测API

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active November 11, 2024 21:28
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

#!/bin/bash
# download MS COCO dataset
#
# ref: http://mscoco.org/dataset/#download
echo "Downloading..."
wget http://msvocds.blob.core.windows.net/annotations-1-0-3/instances_train-val2014.zip && \
@zhang2333
zhang2333 / [译]Visual Studio Code文档其1—基本使用.md
Last active March 8, 2017 14:23
[译]Visual Studio Code文档其1—基本使用

#Visual Studio Code的基本使用 全文翻译自[官方Docs][1]

Visual Studio Code的核心是一个代码编辑器。像许多其他代码编辑器一样,VS Code采用了普遍的UI设计,将显示所有可访问的文件及文件夹的目录树置于左侧,并将文件内容编辑器置于右侧。下面本篇将描述VS Code的几个独特之处。

译者注:NodeJS方面VS Code是Sublime很好的替代品,不妨试试

##文件与Project VS Code以文件、文件夹为基础——你可以通过VS Code打开文件夹来立即启动project。

VS Code可以读写不同框架或平台中不同类型的文件。即便你的VS Code同时打开了package.jsonproject.jsontsconfig.json甚至ASP.NET 5 Visual Studio的项目文件,VS Code仍然可以读取它们并为你提供相应的附加功能,如[IntelliSense][2]。

@danackerson
danackerson / 100_base.conf
Last active September 19, 2024 15:42
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {
@arunoda
arunoda / gist:7790979
Last active September 10, 2024 08:43
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@shijinkui
shijinkui / gist:5132586
Created March 11, 2013 07:41
几个特殊的shell变量
特殊的shell变量:
$0 获取当前执行的shell脚本的文件名
$n 获取当前执行的shell脚本的第n个参数值,n=1..9
$* 获取当前shell的所有参数 “$1 $2 $3 …注意与$#的区别
$# 获取当前shell命令行中参数的总个数