Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Castellucci ryancdotorg

View GitHub Profile
@epixoip
epixoip / sshd_config.diff
Created Apr 10, 2021
ssh pubkey auth only with libpam
View sshd_config.diff
--- /etc/ssh/sshd_config.orig 2021-04-10 05:50:44.673514864 +0000
+++ /etc/ssh/sshd_config 2021-04-10 05:59:56.316912290 +0000
@@ -31,7 +31,7 @@
# Authentication:
#LoginGraceTime 2m
-#PermitRootLogin prohibit-password
+PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
@AjkayAlan
AjkayAlan / WSLWindows10Setup.md
Last active Oct 20, 2021
Windows SubSystem For Linux setup that I like with some developers stuff mixed in
View WSLWindows10Setup.md

Setting Up WSL

Install A Distro:

  1. Run the following in powershell as admin Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  2. Install a distro (ex: Ubuntu 18.04 LTS - https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)

  3. Open your distro you installed via the start menu, let it setup

  4. Update and upgrade

sudo apt-get update
@cemeyer
cemeyer / ⁄etc⁄logrotate.conf
Last active Mar 1, 2021
Sane logrotate.conf settings
View ⁄etc⁄logrotate.conf
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
compress
compresscmd /bin/zstd
compressext .zst
compressoptions -18 -T0 --rm
@mimoo
mimoo / erase_from_memory.h
Last active Jul 15, 2021
Include this file to get the `erase_from_memory` function that zeros memory. See https://www.cryptologie.net/article/419/zeroing-memory-compiler-optimizations-and-memset_s/
View erase_from_memory.h
#ifndef __ERASE_FROM_MEMORY_H__
#define __ERASE_FROM_MEMORY_H__ 1
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdlib.h>
#include <string.h>
void *erase_from_memory(void *pointer, size_t size_data, size_t size_to_remove) {
#ifdef __STDC_LIB_EXT1__
memset_s(pointer, size_data, 0, size_to_remove);
@mohanpedala
mohanpedala / OpenSSL.md
Last active Oct 6, 2021
OpenSSL Working with SSL Certificates, Private Keys, CSRs and Truststores
View OpenSSL.md

Generate a private key and a CSR(Certificate Signing Request )

Use this method if you want to use HTTPS (HTTP over TLS) to secure your Apache HTTP or Nginx web server, and you want to use a Certificate Authority (CA) to issue the SSL certificate. The CSR that is generated can be sent to a CA to request the issuance of a CA-signed SSL certificate. If your CA supports SHA-2, add the -sha256 option to sign the CSR with SHA-2.

Creating a 2048-bit private key (domain.key) and a CSR (domain.csr) from scratch:

openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr

Creating a 2048-bit private key and public key

@hammady
hammady / solr.service
Created Jan 9, 2017
systemd service file for Apache SOLR
View solr.service
# put this file in /etc/systemd/system/ as root
# below paths assume solr installed in /opt/solr, SOLR_PID_DIR is /data
# and that all configuration exists in /etc/default/solr.in.sh which is the case if previously installed as an init.d service
# change port in pid file if differs
# note that it is configured to auto restart solr if it fails (Restart=on-faliure) and that's the motivation indeed :)
# to switch from systemv (init.d) to systemd, do the following after creating this file:
# sudo systemctl daemon-reload
# sudo service solr stop # if already running
# sudo systemctl enable solr
# systemctl start solr
@jmshal
jmshal / atob.js
Last active Jul 9, 2021
Node.js ponyfill for atob and btoa encoding functions
View atob.js
module.exports = function atob(a) {
return new Buffer(a, 'base64').toString('binary');
};
@jayeye
jayeye / README.md
Created Oct 3, 2016
Setting up ISC dhclient on debian / ubuntu for prefix delegation
View README.md

My ISP (Time Warner Cable) hands out IPv6 addresses with DHCPv6; it will delegate a /56 if asked. So long as I keep refreshing the lease, it won't renumber me. I have my cable modem set to bridge, and do all the firewalling, NATing, etc., on a Debian box. In what follows, eth0 is the internal interface.

The dhclient that ships with debian/ubuntu does not support asking for a prefix delegation, so I had to build one from sources.

@bendc
bendc / supportsES6.js
Created Aug 25, 2016
Test if ES6 is ~fully supported
View supportsES6.js
var supportsES6 = function() {
try {
new Function("(a = 0) => a");
return true;
}
catch (err) {
return false;
}
}();
@darconeous
darconeous / engenius-eap600-enable-ssh.md
Last active Sep 19, 2021
Enabling SSH on Engenius EAP600
View engenius-eap600-enable-ssh.md

Enabling SSH on Engenius EAP600 (and maybe other models)

This tutorial will walk you through the steps needed to get root SSH access on an Engenius EAP600 dual-band WiFi access point. SSH doesn't come enabled out of the box on these things, so if you want to SSH into the device (which is running an old version of OpenWRT), keep reading.