Skip to content

Instantly share code, notes, and snippets.

View yunpengn's full-sized avatar
:octocat:
Coding

Yunpeng Niu yunpengn

:octocat:
Coding
View GitHub Profile
@yunpengn
yunpengn / imdb_setup_ftp.sh
Last active February 6, 2020 10:33
A simple script to setup IMDb movie database
printf "Program starts at %s.\n" "$(date)"
printf "Going to clean and create new folder ...\n"
rm -rf imdb-datasets-ftp/ imdb-queries/
mkdir imdb-datasets-ftp/
printf "Going to download datasets from FTP server ...\n"
wget http://homepages.cwi.nl/~boncz/job/imdb.tgz
tar -xvzf imdb.tgz -C imdb-datasets-ftp/
rm -f imdb.tgz
@yunpengn
yunpengn / papertrail.md
Last active March 15, 2020 05:13
Instructions for setting up Papertrail client on Linux

Follow the steps below:

  • Download the latest remote_syslog2 client.
  • Unzip the file by tar -xvzf remote_syslog_linux_amd64.tar.gz.
  • Modify the configuration inside example_config.yml. It should be ideally something similar as:
files:
  - path: app.log
 tag: app_name

Keybase proof

I hereby claim:

  • I am yunpengn on github.
  • I am yunpengn (https://keybase.io/yunpengn) on keybase.
  • I have a public key ASBJiMvGJsXgV08486FElJZ3uwEx6XVtoa8j9umVMggk2Qo

To claim this, I am signing this object:

@yunpengn
yunpengn / README.md
Last active September 24, 2021 14:24
CVE-2020-16303 use-after-free vulnerability in Artifex Software GhostScript v9.50

Setup Instructions

  • Download GhostScript GhostPDL v9.50 from their GitHub release.
    • Need to download both the official build and the source code.
    • Official build (without fix): wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/ghostscript-9.50-linux-x86_64.tgz.
    • Official build (with fix): wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs951/ghostscript-9.51-linux-x86_64.tgz.
  • Compile from source code in the following steps:
    • Get the source code git clone git@github.com:ArtifexSoftware/ghostpdl.git.
    • Change to the correct version git checkout b5bc53eb7.
  • Make sure you have installed gcc, make and autoconf.
@yunpengn
yunpengn / q131.py
Last active September 20, 2021 15:39
Some Python exercises
import datetime
# Defines the increment.
delta = datetime.timedelta(days=1)
# Reads the number of test cases and all inputs.
n = int(input())
ranges = [input() for _ in range(n)]
# Iterates over every test case