Skip to content

Instantly share code, notes, and snippets.

View lvzongting's full-sized avatar

lvzongting lvzongting

View GitHub Profile
@lvzongting
lvzongting / atom.md
Last active August 20, 2017 08:08
安装atom 编辑器无需root权限

##在没有root权限的时候使用linuxbrew安装atom

  1. brew install libsecret --without-gobject-introspection
  2. brew install llvm --with-libcxx
  3. export LDFLAGS="-L/data/hongyang/.linuxbrew/opt/llvm/lib -Wl,rpath,/data/hongyang/.linuxbrew/opt/llvm/lib"
    export CC="clang"
    export CXX="clang++"
  4. brew install nvm
    export NVM_DIR="$HOME/.nvm"
    . "/data/hongyang/.linuxbrew/opt/nvm/nvm.sh"
@lvzongting
lvzongting / torch7.md
Last active August 7, 2017 06:25
torch7在archlinux下的最简单的安装方法.

archlinux下安装torch7的方法

打开archlinux cn这个源
然后:
pacman -Sy loadcaffe-git torch7-cunn-git torch7-cutorch-git torch7-cwrap-git torch7-dok-git torch7-env-git torch7-git torch7-graph-git torch7-hdf5-git torch7-image-git torch7-lmdb-git torch7-nn-git torch7-nngraph-git torch7-optim-git torch7-paths-git torch7-sys-git torch7-tds-git torch7-threads-git torch7-xlua-git
yaourt -S torch7-trepl-git
如果不会打开这个源那么,就这样
yaourt -Sy loadcaffe-git torch7-cunn-git torch7-cutorch-git torch7-cwrap-git torch7-dok-git torch7-env-git torch7-git torch7-graph-git torch7-hdf5-git torch7-image-git torch7-lmdb-git torch7-nn-git torch7-nngraph-git torch7-optim-git torch7-paths-git torch7-sys-git torch7-tds-git torch7-threads-git torch7-xlua-git torch7-trepl-git

如果有些包装不上,那么
yaourt torch7

@lvzongting
lvzongting / wget-gdrive.sh
Last active September 20, 2019 03:51
download google drive file only with wget 仅通过wget 在bash命令行下载谷歌网盘(狗哥网盘)上的文件
#reference https://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal
#get cookie and code
wget --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/Code: \1\n/p'
#download the file
wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm=CODE_FROM_ABOVE&id=FILEID'
@lvzongting
lvzongting / install_mosh_locally.sh
Created March 30, 2017 09:27
install_mosh_locally.sh install mosh from source without root permission
#!/bin/sh
# this script does absolutely ZERO error checking. however, it worked
# for me on a RHEL 6.5 machine on 2017-03-30. clearly, the version numbers
# and/or URLs should be made variables. cheers, lvzongting@gmail.com
# fork from https://gist.github.com/xiaom/8264691
mkdir mosh
cd mosh
@lvzongting
lvzongting / Mac os 打印驱动 for linux
Created October 27, 2014 03:28
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。
Mac os 打印驱动 for linux
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。这里只是记录了一个方法,为了方便大家使用,我正在寻找一个网络空间可以将我提取出来的这些ppd驱动文件上传上去提供大家下载,可能还会提供一个便于检索的网页,如果大家有需要什么打印驱动的话,可以在这个gist后面留言。
当然,我也会积极的将这些文件进行打包,然后丢到各大软件源中。以方便大家的使用。
真心希望,linux这样好用的系统能快速发展,普及,能让更多的人感受到使用linux的快乐。
苹果系统 Mac OS 打印驱动用在linux系统。(通过cups 通用Unix打印系统ppd格式化文件驱动打印机)
% Compile the PROPACK package
% Copyright LI, Wei(@kuantkid)
% detect gfortran
switch (lower(computer))
case 'glnxa64'
fc = 'gfortran';
suffix = 'mexa64';
case 'glnxa32'
fc = 'gfortran';
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@lvzongting
lvzongting / db_fm.py
Created February 13, 2012 02:30 — forked from yanyaoer/db_fm.py
listening my douban.fm with python & mpg123
# vim: set et sw=4 ts=4 sts=4 fdm=syntax ff=unix fenc=utf8:
#!/usr/bin/python
import json
from subprocess import Popen
import urllib2
_url = 'http://douban.fm/j/mine/playlist?type=n&h=&channel=0'
req = urllib2.urlopen(urllib2.Request(_url))
obj = json.load(req)