Skip to content

Instantly share code, notes, and snippets.

View nfacciolo's full-sized avatar

facciolo nfacciolo

View GitHub Profile
@sio2boss
sio2boss / client-socket-reconnect.js
Created August 25, 2013 14:19
Node.js Re-connecting Socket
//
// Simple example of using net.Socket but here we capture the
// right events and attempt to re-establish the connection when
// is is closed either because of an error establishing a
// connection or when the server closes the connection.
//
// Requires
var net = require('net');
@sid24rane
sid24rane / net.js
Last active May 19, 2024 07:28
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@thibaut-decherit
thibaut-decherit / Symfony - Serve Private File.md
Created February 20, 2020 17:21
Symfony - Serve Private File

Symfony - Serve Private File

Following example demonstrates how to:

  • display a private file download prompt to the user (here for a PDF file)
  • serve a private image or PDF which will be displayed on a webpage

See https://symfony.com/doc/4.4/components/http_foundation.html#serving-files

Host these files in a directory outside of /public, so they can be accessed only through the controller and its @Security() authorization. For example you could create a /private-uploads directory at the root of your project.

@gjreasoner
gjreasoner / README.md
Last active April 25, 2024 01:42
Expand Ubuntu 20 Proxmox Disk
# Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click "Resize disk" button

# Confirm increase in disk space (1TB in my case)
$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0    1T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0    1T  0 part