Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Dev guide

libertysoft3 edited this page May 5, 2022 · 3 revisions

Locally mounting VM or server files

$ sudo apt-get install sshfs
$ mkdir ~/vm
$ sshfs reddit@reddit.local:/home/reddit/src/reddit ~/vm
# optionally unmount it later with:
$ fusermount -u ~/vm

Logging

$ sudo tail -f /var/log/syslog
> g.log.warning("hello log")

Profiling

Set profile_directory in development.update to an absolute path and create the directory first. cProfile results can be viewed with pstats.

Memory by process

ps aux  | awk '{print $6/1024 " MB\t\t" $11}'  | sort -n

SSL upgrade, for improved "Suggest Title" compatibility

Upgrade curl

Ubuntu 14 comes with curl 7.35.0. Upgrade it for improved SSL compatibility, particularly for "suggest title" and other remote fetching.

$ sudo apt-get remove curl libcurl3
$ sudo apt-get install build-essential
# substitute version from https://curl.haxx.se/download.html
$ wget https://curl.haxx.se/download/curl-7.65.1.tar.bz2
$ tar -xvjf curl-7.65.1.tar.bz2
$ cd curl-7.65.1
$ ./configure --prefix=/usr
$ make
$ sudo make install
$ sudo ldconfig
$ curl --version
$ cd ..
$ rm -rf curl-7.65.1*

Rebuild reddit open source

$ sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev
$ cd ~/src/reddit/r2
$ sudo reddit-stop
$ python setup.py build
$ sudo python setup.py develop
$ make clean
$ make build/mangle-buildstamp
$ make -j $(nproc)
$ sudo reddit-start
$ sudo reddit-flush
Clone this wiki locally