Skip to content

Instantly share code, notes, and snippets.

View makerj's full-sized avatar
💗

Junhee Lee makerj

💗
View GitHub Profile
@makerj
makerj / .htaccess
Created January 28, 2016 18:39 — forked from fabiocicerchia/.htaccess
Apache - PUT - 405 Method Not Allowed
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.+$ - [NC,L]
RewriteCond %{REQUEST_METHOD} (PUT|DELETE)
RewriteRule .* put.php
@makerj
makerj / main.py
Created May 28, 2016 14:45 — forked from makersm/main.py
email notifier using multiprocessing(manager process, worker process[pool])
import os
import random
from multiprocessing import Queue, Process, Pool
from time import sleep
class EmailNotifier:
def __init__(self):
self.r_queue = Queue()
self.manager_proc = Process(target=EmailNotifier.init_manager_proc, name='EmailNotifier', args=(self.r_queue,))
@makerj
makerj / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created April 9, 2017 05:40 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \

Laptop running as a server

I am running an old Dell Laptop as a server with Ubuntu 18.04 on it. Installing Ubuntu on the system was straight forward, but at a certain point you want to close the lid of the laptop. This puts your laptop in sleep, which for a server is not the intended result.

Disable Sleep on Lid Close

Debians Suspend Wiki page had the right solution for this