Skip to content

Instantly share code, notes, and snippets.

@darcyliu
darcyliu / install_spark_centos7.sh
Created April 1, 2016 09:40
Install Spark on CentOS 7
#!/bin/bash
# Install Spark on CentOS 7
yum install java -y
java -version
yum install wget -y
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz
tar xvf scala-2.11.7.tgz
sudo mv scala-2.11.7 /usr/lib
sudo ln -s /usr/lib/scala-2.11.7 /usr/lib/scala
@darcyliu
darcyliu / install_mlpack_osx.sh
Created March 31, 2016 22:28
Install mlpack on OSX 10.11 (EI Capitan)
#!/bin/bash
# Install mlpack on OSX 10.11 (EI Capitan)
curl -O http://tenet.dl.sourceforge.net/project/arma/armadillo-6.500.5.tar.gz
tar zxvf armadillo-6.500.5.tar.gz
cd armadillo-6.500.5
./configure
make
make install
cd ..
@darcyliu
darcyliu / install_mlpack.sh
Created March 22, 2016 14:38
Install mlpack on CentOS 7
#!/bin/bash
# Install mlpack on CentOS 7
yum -y groupinstall "Development Tools"
yum -y install epel-release
yum -y install boost-devel boost-test boost-program-options boost-math libxml2-devel armadillo-devel
yum -y install txt2man
yum -y install cmake
wget http://www.mlpack.org/files/mlpack-2.0.1.tar.gz
tar xzvf mlpack-2.0.1.tar.gz
@darcyliu
darcyliu / phonetic.m
Last active February 22, 2016 13:19
phonetic transcription
//
// main.m
// phonetic transcription
//
// Created by Darcy Liu on 20/02/2016.
// Copyright © 2016 Darcy Liu. All rights reserved.
//
// clang main.m -fobjc-arc -fmodules -o main
@darcyliu
darcyliu / apache.conf
Last active March 21, 2017 17:54
Issue Let's Encrypt certificates on CentOS
# host challenge files on Apache for your domain
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/example.domain
ServerName example.domain
# Add following code to your Apache VirtualHost
Alias "/.well-known/acme-challenge" "/var/www/challenges/"
<Directory "/var/www/challenges/">
Header set Content-Type "application/jose+json"
@darcyliu
darcyliu / centos7_timechine.sh
Last active April 25, 2022 18:17
Install Time Machine service on CentOS 7
# Install Time Machine service on CentOS 7
# http://netatalk.sourceforge.net/wiki/index.php/Netatalk_3.1.7_SRPM_for_Fedora_and_CentOS
# http://confoundedtech.blogspot.com/2011/07/draft-draft-ubuntu-as-apple-time.html
yum install -y rpm-build gcc make wget
# install netatalk
yum install -y avahi-devel cracklib-devel dbus-devel dbus-glib-devel libacl-devel libattr-devel libdb-devel libevent-devel libgcrypt-devel krb5-devel mysql-devel openldap-devel openssl-devel pam-devel quota-devel systemtap-sdt-devel tcp_wrappers-devel libtdb-devel tracker-devel
yum install -y bison docbook-style-xsl flex dconf
@darcyliu
darcyliu / install_opencv_on_osx.sh
Last active April 3, 2016 22:03
Install OpenCV on OS X Yosemite
#!/bin/bash
# Install OpenCV on OS X Yosemite
# # install cmake
# curl -O https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz
# tar xzvf cmake-3.4.3.tar.gz
# cd cmake-3.4.3
# ./bootstrap
# make
# make install
@darcyliu
darcyliu / NSString+AppStore.h
Created November 5, 2014 05:51
Short links to the App Store for your apps and company
//
// NSString+AppStore.h
// NSString+Additions
//
// Created by Darcy Liu on 11/5/14.
// Copyright (c) 2014 Darcy Liu. All rights reserved.
//
#import <Foundation/Foundation.h>
@darcyliu
darcyliu / result.txt
Created October 29, 2014 06:14
text height calculation
size: {102.804, 486.74399999999957}
rect: {{0, 0}, {102.804, 486.74399999999957}}
suggestedSize: {98.6953125, 480}
rect: {{0, 0}, {100, 487}}
@darcyliu
darcyliu / manifest.plist
Created October 28, 2014 02:48
iOS Application Ad hoc distribution manifest
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>