Posts

A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android

Image
I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...

connect shadowsocks server on ubuntu via ss-local

#Server config [Set up your own shadowsocks server](https://errong.win/2018/06/05/setup-shadowsocks-on-ubuntu-16-04/) or found/buy one. You should have a shadowsocks server with below informations: * server ip * server port * password * method #install ~~~ sudo apt-get install software-properties-common -y sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y sudo apt-get update sudo apt install shadowsocks-libev ~~~ #configure match to the server's info. ~~~ sudo vim /etc/shadowsocks-libev/config.json {     "server":"xx.xx.xx.xx", // server IP     "server_port":8911,     "local_port":1008, // local port     "password":"jesuslove",     "timeout":60,     "method":"chacha20-ietf-poly1305" } ~~~ #run ss-local ```sudo ss-local -c  /etc/shadowsocks-libev/config.json``` #export socks proxy system wide ~~~ export http_proxy=socks5://127.0.0.1:1008 export https_proxy=socks5://127.0.0.1:1008 ~~~ #u...

c++: Max Heap Template

https://en.wikipedia.org/wiki/Min-max_heap My simple implementation of max heap. Change the compare from > to < in below codes, you will get a min heap. template<typename T> class MaxHeap { public: MaxHeap() { size_ = 0; capacity_ = 2; heap_ = new T[capacity_]; } MaxHeap(int capacity) { if (capacity >= 2) { heap_ = new T[capacity]; capacity_ = capacity; size_ = 0; } else { size_ = 0; capacity_ = 2; heap_ = new T[capacity_]; } } ~MaxHeap() { if (heap_) delete[] heap_; } public: int size() { return size_; } void insert(const T& t) { if ((size_+1) >= capacity_) { capacity_ *= 2; T* tmp = new T[capacity_]; for (int i = 0; i <= size_; i++) tmp[i] = heap_[i]; delete[] heap_; heap_ = tmp; } size_++; heap_[size_] = t; int i = size_; int tmp = heap_[i]; while (i > 1 && tmp > heap_[i / 2]) { heap_[i] = heap_[i / 2]; heap_[i / 2] = tmp; tmp = heap_[i / 2]; i /= 2;...

Ember.js : Custom "index" route's path and Custom "/" path's route

Image
"index" Route The index route, which will handle requests to the root URI (/) of our site. How to generate a new route called index: ember g route index The index route is special: it does NOT require an entry in the router's mapping. a Nested "index" Route An index nested route works similarly to the base index route. It is the default route that renders when no route is provided. Use 'rentals' as example, when we navigate to /rentals, Ember will attempt to load the rentals index route as a nested route. To create an index nested route, run the following command: ember g route rentals/index If you open up your Router (app/router.js) you may notice that the rentals line has changed. This extra function() {} is required because it needs a child route, the this.route('index', { path: '/'}); is implied. Router.map(function() { this.route('about'); this.route('contact'); this.route('rentals', functi...

Set up gitweb server on nginx

Image
Precondition please setup your git server via git-http-backend on nginx. Setup gitweb conf sudo apt-get install gitweb /etc/gitweb.conf is Gitweb (Git web interface) configuration file The default project root is /usr/lib/git. Here, I changed to my own path. our $projectroot = "/home/errong_leng/www/git"; Change nginx conf cat /etc/nginx/sites-enabled/git.errong.win.conf server { listen 80; listen [::]:80; server_name git.errong.win; auth_basic "Restricted"; auth_basic_user_file /home/errong_leng/.gitpasswd; location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ { root /home/errong_leng/www/git; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; fastcgi_param PATH_INFO $uri; fastcgi_param GIT_PROJECT_ROOT /home/errong_leng/www/git; fastcgi_param GIT_HTTP_EXPORT_ALL ""; fastcgi_param REMOTE_USER $remote_user; in...

Install Perl module on ubuntu

Install by cpan cpan -i foo Replace foo with the module name you want to install. Install from source Search the module on cpan.org Download the source. Let's use HTML::Entities for example. You will get your search url: http://search.cpan.org/~gaas/HTML-Parser-3.72/lib/HTML/Entities.pm The source url will be: http://www.cpan.org/authors/id/G/GA/GAAS/HTML-Parser-3.72.tar.gz Make and install perl module tar -xvf HTML-Parser-3.72.tar.gz cd HTML-Parser-3.72/ perl Makefile.PL make sudo make install

setup http/https git server on nginx via git-http-backend

Precondition sudo apt-get install nginx fcgiwrap git apache2-utils Set up https server First, please setup your https server by your self. You can refer to my guide git-http-backend git-http-backend is a Server side implementation of Git over HTTP. /usr/lib/git-core/git-http-backend Set Up Password Authentication file for your git server We can get a password with MD5-based password algorithm, Apache variant via openssl passwd command. You can add a username to the file using this command. We are using sammy as our username, but you can use whatever name you'd like: sudo sh -c "echo -n 'sammy:' >> .gitpasswd" Next, add an encrypted password entry for the username by typing: sudo sh -c "openssl passwd -apr1 >> .gitpasswd" You can repeat this process for additional usernames. You can see how the usernames and encrypted passwords are stored within the file by typing: cat .gitpasswd Output sammy:$apr1$wI1/T0nB$jEKuTJHkTOOWk...

setup https server via An ACME Shell script on nginx

I will give every detail steps when I setup https server for https://git.errong.win . You can refer as a guide. acme.sh acme.sh is probably the easiest & smartest shell script toautomatically issue & renew the free certificates from Let's Encrypt . Install the shell script via guide http server nginx conf First, let's setup a http server first via nginx. After you installed nginx, the simple way to setup a http server is to add a conf file under /etc/nginx/sites-enabled/ folder. cat /etc/nginx/sites-enabled/git.errong.com.conf server { listen 80; listen [::]:80; server_name git.errong.com; location / { root html; index index.html index.htm; } } Reload nginx via sudo nginx -s reload issue free certificates sudo acme.sh --issue --home /etc/letsencrypt --domain example.com --webroot /home/errong_leng/www/git --reloadcmd "nginx -s reload" --accountemail errong.leng@gmail.com [Wed Jun 13 01:51:07 ...