Skip to content

Instantly share code, notes, and snippets.

@sfpprxy
sfpprxy / cleanup_swap.md
Created June 12, 2023 05:51 — forked from anildigital/cleanup_swap.md
Cleanup swap space on macOS

To see current swap usage

sysctl -a | grep swap

Use only when when your system is in a very bad shape

$ sudo pkill -HUP -u _windowserver 
@sfpprxy
sfpprxy / no-ssh-password-mac.txt
Created June 12, 2019 06:58 — forked from eegrok/no-ssh-password-mac.txt
disable password ssh authentication on mac os
make sure the following lines are set in /etc/sshd_config (or /etc/ssh/sshd_config on ubuntu)
(they all exist already, but are commented, some may have a value of yes)
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
then restart the ssh server (uncheck / recheck 'Remote Login' in the 'System Preferences' -> 'Sharing' panel)
@sfpprxy
sfpprxy / install-apache-maven-3.5.2.sh
Last active April 18, 2018 05:41 — forked from dragolabs/install-apache-maven-3.5.0.sh
Install Apache Maven 3.5.2 on CentOS
#!/bin/sh
wget https://mirrors.cnnic.cn/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
tar xzf apache-maven-3.5.2-bin.tar.gz
mkdir /opt/maven
mv apache-maven-3.5.2/ /opt/maven/
alternatives --install /usr/bin/mvn mvn /opt/maven/apache-maven-3.5.2/bin/mvn 1
alternatives --config mvn
@sfpprxy
sfpprxy / cors_server.py
Created November 28, 2016 05:12 — forked from enjalot/cors_server.py
Allow CORS with python simple http server
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or