Skip to content

Instantly share code, notes, and snippets.

@ngocdon0127
ngocdon0127 / protect-pve-vm-from-oom-killer.md
Last active February 13, 2025 09:53 — forked from oetiker/README.md
Protecting a Proxmox VM from being killed by the OOM Killer

Protecting a Proxmox VM from the OOM Killer

VMs tend to occupy a lot of memory, but they are normally also the official denizens of a server. So if memory gets tight we rather have the oom killer kill the new kid on the block (some process which has suddenly started using more ram) instead of the regular VM crowd.

Obviously bad things will happen if the oom killer is not able to free enough memory to make your machine happy again, but with this you at least have some control over who gets killed.

The Hookscript Method

@ngocdon0127
ngocdon0127 / vps-test-dd.md
Created October 14, 2018 17:27 — forked from rictorres/vps-test-dd.md
VPS performance tests

Using dd

RunAbove Sandbox [ra]

  • 1 core / 2 GB RAM / 20 GB SSD

EC2 Micro [ec]

  • 1 core / 1 GB RAM / 8 GB

Digital Ocean [do]

  • 1 core / 512 MB RAM / 20 GB SSD
$(window).off('blur')
$(window).blur(function () {
var count = $.cookie("lost_focus_count_" + UserTest);
if (!count || isNaN(count)) count = 0;
count++;
TestCertificate.Common.showMessenger(TestCertificate.Common.getResource("LOST_FOCUS", count));
$.ajax({
Download and install: http://security.ubuntu.com/ubuntu/pool/main/n/nss/libnss3_3.28.4-0ubuntu0.16.04.3_amd64.deb
### Install:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
### Config:
{
"bold_folder_labels": true,
"charset": "utf-8",
@ngocdon0127
ngocdon0127 / vnc-on-centos-6.md
Last active April 1, 2018 06:53 — forked from antoniojxk/vnc-on-centos-6.md
how to install VNC on CentOS 6.8
@ngocdon0127
ngocdon0127 / base64-image-upload.js
Created November 9, 2017 07:50 — forked from madhums/base64-image-upload.js
save base64 encoded image
/*
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674
*/
var fs = require('fs');
// string generated by canvas.toDataURL()
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0"
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO"
+ "3gAAAABJRU5ErkJggg==";
// strip off the data: url prefix to get just the base64-encoded bytes

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
var dbname = 'testing_geojsonPoint';
@ngocdon0127
ngocdon0127 / Sublime Text 3 Build 3103 License Key - CRACK
Created September 21, 2016 02:39
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04