Skip to content

Instantly share code, notes, and snippets.

View ynrng's full-sized avatar

ynrng

  • University of Birmingham
  • Shanghai, China
View GitHub Profile
@ynrng
ynrng / backupdir.sh
Created June 7, 2024 04:15
backup current whole directory including hidden files to a target position --target_dir with same name folder created; keep --n copies and delete oldest one automatically. Usage in first few lines.
#!/bin/bash
# Open the crontab file for editing:
# sudo crontab -e
# Add the following line to the crontab file:
# 0 0 * * * /dir/to/backupdir.sh --target_dir /dir/to/backups --n 24
TARGET_DIR="/media/yan"
MAX_BACKUPS=1
@ynrng
ynrng / discord.ipynb
Last active May 30, 2024 06:32
Draw a stacked bar chart of predicted discord gender. [Require data from Discord](https://support.discord.com/hc/en-us/articles/360004027692-Requesting-a-Copy-of-your-Data) and find json in /activity/analytics/events-*json.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ynrng
ynrng / nvidia-driver-realtime.sh
Created May 15, 2024 15:52 — forked from pantor/nvidia-driver-realtime.sh
Installing NVIDIA drivers on a realtime Linux (PREEMPT-RT)
# Tested on Ubuntu 16.04 and X11, 2019
# 1. Download NVIDIA driver as a .run file
# 2. Stop X-Server
sudo service lightdm stop
# 3. Blacklist Nouveau driver
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
@ynrng
ynrng / ubuntu_update_booting_kernel.md
Created February 10, 2023 20:47 — forked from chaiyujin/ubuntu_update_booting_kernel.md
Ubuntu: Install Kernel and Set GRUB Default Kernel

Ubuntu: Install Kernel and Set GRUB Default Kernel

Install Kernel

Install the default kernel:

sudo apt install linux-generic

Set GRUB Default Kernel

  1. Find entrance from /boot/grub/grub.cfg
    • Get the $menuentry_id_option:
@ynrng
ynrng / proxy_setup.md
Created January 16, 2023 22:11 — forked from justagist/proxy_setup.md
Proxy Setup - Ubuntu 18.04 (apt, docker, curl)

Environment proxy variables:

Replace your proxy hostname and port number instead of webcache.cs.bham.ac.uk:3128 below.

Set the following in your .bashrc file:

export HTTP_PROXY=http://webcache.cs.bham.ac.uk:3128
export HTTPS_PROXY=http://webcache.cs.bham.ac.uk:3128
export FTP_PROXY=http://webcache.cs.bham.ac.uk:3128