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
ffmpeg -i \#Architecture.mov -ss 00:00:01 -vcodec libx264 -preset fast -crf 23 -vf "scale=640:-1" -acodec libmp3lame -ab 128k architecure.mp4 | |
# -ss 00:00:01 cut begin at 00:00:01 | |
# -crf 23 压缩程度(数字越大,体积越小) | |
# -vf "scale=640:-1" 缩放 |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Origin: https://github.com/RussellLuo/pdfbookmarker | |
import sys | |
import os | |
import re | |
from PyPDF2 import PdfFileMerger, PdfFileReader | |
def addBookmarks(pdf_in_filename, bookmarks_tree, pdf_out_filename=None): |
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
from pyhive import hive# or import hive | |
from pyhdfs import HdfsClient | |
data_csv = '/root/demo/data/train.csv' | |
hdfs = HdfsClient('hadoopmaster.hadoop.test', user_name='admin') | |
hdfs.copy_from_local(data_csv, '/user/admin/data/titanic/train.csv') | |
hive_cursor= hive.connect('hadoopslave1.hadoop.test', username='admin').cursor() |
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
#!/usr/bin/env python | |
import sys | |
try: | |
from PyPDF2 import PdfFileReader, PdfFileWriter | |
except ImportError: | |
from pyPdf import PdfFileReader, PdfFileWriter | |
import os | |
def concatenate(input_files, output_file): | |
input_streams = [] |
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
Windows Registry Editor Version 5.00 | |
;图片 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag] | |
"ThisPCPolicy"="Hide" | |
;视频 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag] | |
"ThisPCPolicy"="Hide" |
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
/////////////////////////////////////////////////////// | |
// Binary Indexed Tree 树状数组 | |
/////////////////////////////////////////////////////// | |
#include <cassert> | |
template<typename T, int N> class BIT { | |
public: | |
T c[N]; | |
void init() { memset(c, 0, sizeof(c)); } | |
int lowbit(int x) { return x & (-x); } |
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
""" | |
Enable to import .ipynb files in the same way that the .py files are. | |
Usage: import this file before you import .ipynb files. | |
Reference: http://nbviewer.jupyter.org/github/jupyter/notebook/blob/master/docs/source/examples/Notebook/Importing%20Notebooks.ipynb# | |
""" | |
import io, os, sys, types | |
from nbformat import read |
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
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.10.1 | |
user=root | |
remote_addr=192.168.0.1 | |
scp ~/.ssh/id_rsa.pub $user@$remote_addr:/tmp/pub | |
ssh -l $user $remote_addr "cat /tmp/pub >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" |
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
// Reference: | |
// https://www.cnblogs.com/HarryGuo2012/p/4722784.html | |
// http://blog.csdn.net/fcxxzux/article/details/40053937 | |
#include <cstring> | |
#include <cstdio> | |
#include <cstdlib> | |
int dfs(int i) { | |
int a[100]; |
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
Windows Registry Editor Version 5.00 | |
[-HKEY_CLASSES_ROOT\Directory\shell\runas] | |
[HKEY_CLASSES_ROOT\Directory\shell\runas] | |
@="Open command window here as Administrator" | |
"HasLUAShield"="" | |
[HKEY_CLASSES_ROOT\Directory\shell\runas\command] | |
@="cmd.exe /s /k pushd \"%V\"" |