Skip to content

Instantly share code, notes, and snippets.

@pchan37
pchan37 / install_java_manually.sh
Last active January 24, 2018 01:52
Manually install Java JDK 1.8 update 162 (cuz you don't want to screw yourself over)
#!/usr/bin/env bash
echo 'Removing old version of openjdk'
sudo apt remove openjdk-8-jdk openjdk-8-jre -y
sudo apt autoremove -y
echo 'Download jdk 1.8.0 update 162'
wget --quiet -c --header "Cookie: oraclelicense=accept" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz
echo 'Installing jdk 1.8.0 update 162'
tar -zxf jdk-8u162-linux-x64.tar.gz
@pchan37
pchan37 / install_emacs.sh
Last active October 24, 2020 13:55
Install Emacs on Elementary OS
#!/bin/bash -e
sudo apt update -y
sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-elisp/ppa -y
sudo apt update && sudo apt install emacs25
# emacs25.desktop:
cp /usr/share/applications/emacs25.desktop ~/.local/share/applications
# Replace the Exec line with: Exec=Exec=/usr/bin/env XLIB_SKIP_ARGB_VISUALS=1 emacsclient -a '' -n -c %F
@pchan37
pchan37 / uninstall_wps_office_linux.sh
Created October 25, 2017 06:14
Uninstall WPS Office on Linux and required symbols
echo 'Removing WPS Office...'
sudo apt remove wps-office
sudo apt autoremove
echo 'Removing symbols required for WPS Office...'
sudo rm -rf /usr/share/fonts/wps-fonts
echo 'Rebuilding font cache...'
fc-cache -fvs
@pchan37
pchan37 / install_wps_office_linux.sh
Last active April 13, 2024 19:08
Install WPS Office on Linux including the missing symbols
#!/bin/bash -e
echo 'WPS Office installation script brought to you by PChan!'
echo 'Downloading WPS Office!'
wget -q http://kdl1.cache.wps.com/ksodl/download/linux/a21//wps-office_10.1.0.5707~a21_amd64.deb
echo 'Downloading the symbols for WPS Office!'
wget -q https://github.com/IamDH4/ttf-wps-fonts/archive/master.zip
@pchan37
pchan37 / fix_dualboot_time.bat
Created October 24, 2017 18:06
Fix Windows Time when dualbooting
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
:init
setlocal DisableDelayedExpansion
@pchan37
pchan37 / disable_cortana.bat
Last active October 24, 2017 17:35
Disable Cortana once and for all!
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
:init
setlocal DisableDelayedExpansion
@pchan37
pchan37 / install_sbu_printer.py
Last active September 12, 2018 23:44
Install sbu printer on Linux (Python Version, Tested on Ubuntu 16.04)
import subprocess
PRINTER_PPD_FILE_CONTENT = """
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@pchan37
pchan37 / install_sbu_printer.sh
Last active September 12, 2018 23:44
Install sbu printer on Linux (Tested on Ubuntu 16.04)
#!/bin/bash -e
PRINTER_PPD_FILE_CONTENT='*PPD-Adobe: "4.3"\n*%\n*% For information on using this, and to obtain the required backend\n*% script, consult http://www.openprinting.org/\n*%\n*% This file is published under the GNU General Public License\n*%\n*% PPD-O-MATIC (4.0.0 or newer) generated this PPD file. It is for use with\n*% all programs and environments which use PPD files for dealing with\n*% printer capability information. The printer must be configured with the\n*% "foomatic-rip" backend filter script of Foomatic 4.0.0 or newer. This\n*% file and "foomatic-rip" work together to support PPD-controlled printer\n*% driver option access with all supported printer drivers and printing\n*% spoolers.\n*%\n*% To save this file on your disk, wait until the download has completed\n*% (the animation of the browser logo must stop) and then use the\n*% "Save as..." command in the "File" menu of your browser or in the\n*% pop-up manu when you click on this document with the right mouse button.\n*% DO NOT cut a