Skip to content

Instantly share code, notes, and snippets.

@donglixp
donglixp / install_mosh_locally.sh
Last active June 19, 2016 11:06 — forked from lazywei/install_mosh_locally.sh
Install mosh server without root permission
#!/bin/sh
# this script does absolutely ZERO error checking. however, it worked
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers
# and/or URLs should be made variables. cheers, [email protected]
mkdir mosh
@donglixp
donglixp / mosh-server
Created June 19, 2016 13:22
mosh-server for Kerberos/AFS
#!/usr/bin/perl -w
use strict;
use File::Spec::Functions;
use File::Temp;
use FindBin;
my $SERVER = '~/usr/bin/mosh-server.real';
@donglixp
donglixp / fbpython-0.1-1.rockspec
Created July 24, 2016 17:46
fbpython-0.1-1.rockspec
--
-- Copyright (c) 2014, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
--
package = 'fbpython'
@donglixp
donglixp / build.sh
Created July 24, 2016 17:47
thpp installation: build.sh
#!/bin/bash -e
#
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
#
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#author: rex
#blog: http://iregex.org
#filename tr.py
#created: 2010-08-01 20:24
#source uri: http://iregex.org/blog/trie-in-python.html
# escape bug fix by fcicq @ 2012.8.19
luarocks install penlight
luarocks install dpnn
luarocks install json
luarocks install xlua
luarocks install tds
luarocks install threads
luarocks install httpclient
luarocks install sys
luarocks install luafilesystem
luarocks install lua-cjson
@donglixp
donglixp / rouge_perl_setup.sh
Last active May 10, 2022 04:39
Setup ROUGE-1.5.5
# install XML::DOM plugin, instructions https://web.archive.org/web/20171107220839/www.summarizerman.com/post/42675198985/figuring-out-rouge
cpan App::cpanminus
cpanm XML::DOM
# test fails with XLM::Parser missing error, install it
sudo apt-get install libexpat1-dev
cpanm XML::Parser
cd /mnt/data/
git clone https://github.com/andersjo/pyrouge.git
@donglixp
donglixp / QG.md
Last active December 17, 2019 11:44
question generation

docker

alias=`whoami | cut -d'.' -f2`; sudo docker run -it --rm --runtime=nvidia --ipc=host --privileged -v /home/${alias}:/home/${alias} -v /mnt/data:/mnt/data pytorch/pytorch:1.1.0-cuda10.0-cudnn7.5-devel bash

docker setup

apt-get update
apt-get install -y vim wget ssh
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF