Skip to content

Instantly share code, notes, and snippets.

IFS=$'\n'
myUser=`whoami`
echo Local user is $myUser
SYNO_USER=`psql synofoto -t -c "select id from user_info where name='$myUser'"`
echo SYNO_USER is $SYNO_USER
echo Scanning for video files..
for i in `find . -iname \*.mov -type f | grep -v eaDir | grep -v "_3"`; do
#echo i is $i
fname=$(dirname ${i})/@eaDir/$(basename ${i})/SYNOPHOTO_FILM_H.mp4;
@Vincentxiaojie
Vincentxiaojie / downfile.cs
Last active December 17, 2015 21:39
逐行读取文本信息,下载文件
class Program
{
static void Main(string[] args)
{
string path = AppDomain.CurrentDomain.BaseDirectory + "pic.txt";
using (StreamReader sr = new StreamReader(path))
{
WebClient mywebclient = new WebClient();
string line;
while (!string.IsNullOrEmpty(line = sr.ReadLine()))
@Vincentxiaojie
Vincentxiaojie / gist:3188718
Created July 27, 2012 15:36 — forked from zeuxisoo/gist:1205467
Mini Fake DNS server (Python recipe)
## {{{ http://code.activestate.com/recipes/491264/ (r4)
import socket
class DNSQuery:
def __init__(self, data):
self.data=data
self.dominio=''
tipo = (ord(data[2]) >> 3) & 15 # Opcode bits
if tipo == 0: # Standard query
@Vincentxiaojie
Vincentxiaojie / microdns.py
Created July 27, 2012 15:33 — forked from barbuza/microdns.py
fake python dns server for use with mac /etc/resolver system
# -*- coding: utf-8 -*-
import re
import socket
class UnsupportedQuery(BaseException):
pass