Skip to content

Instantly share code, notes, and snippets.

@egorFiNE
egorFiNE / LineStream.js
Created July 6, 2011 12:33
Line-by-line protocol for node.js
var net = require("net");
var events = require("events");
var sys = require("sys");
var fs = require("fs");
function _cutFromRight(str) {
if (str.charAt(str.length-1)=="\n") {
return [str.substr(0,str.length-1), ''];
}
var li = str.lastIndexOf("\n");
@egorFiNE
egorFiNE / FixMysqlBigint.js
Created June 30, 2012 09:52
Fix for node-mysql BIGINT
/*
Usage:
FixMysqlBigint = require('FixMysqlBigint');
mysqlConnection.query("SELECT a,b,c FROM z", function(err, results, fieldInfo) {
if (err) {
...
}
@egorFiNE
egorFiNE / depoison.sh
Last active July 14, 2024 08:23
Script to remove as much systemd & other instanity from Ubuntu Server (only!) as practically possible
# first cleanup
apt -y purge --auto-remove systemd-timesyncd python3-systemd lxd-installer snapd systemd-resolved multipath-tools polkitd libpolkit-gobject-1-0 udisks2 open-iscsi systemd-hwe-hwdb update-notifier-common ubuntu-release-upgrader-core landscape-common unattended-upgrades apport uuid-runtime apparmor dbus dbus-daemon dbus-session-bus-common dbus-user-session dbus-system-bus-common
# we need network-synced time
apt -y install chrony
# at this point there should be no packages in "uninstalled not purged" state, but let's keep the command line here for refs
# dpkg --purge `dpkg -l | grep ^rc | awk '{print $2}'`
# cleanup after cleaning up