Skip to content

Instantly share code, notes, and snippets.

View sdevn's full-sized avatar
💭
sudo rm -rf /

Nilos Psathas sdevn

💭
sudo rm -rf /
View GitHub Profile
@dbehnke
dbehnke / client.py
Created March 18, 2014 19:08
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
"""
client.py - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running server.py
It will handshake and run similar to this:
Server: HELLO
Client: WORLD
@rishabhmhjn
rishabhmhjn / executeShellInGradle
Created November 5, 2014 07:26
Executing shell commands and getting output in gradle
def getVersionName = { ->
def hashStdOut = new ByteArrayOutputStream()
exec {
commandLine "git", "rev-parse", "--short", "HEAD"
standardOutput = hashStdOut
}
def buildNumberStdOut = new ByteArrayOutputStream()
exec {
commandLine 'echo', "$BUILD_NUMBER"
@Rambou
Rambou / SSO and LDAP
Last active January 16, 2022 15:05
Greek Universities SSO and LDAP servers
Agricultural University of Athens - https://sso.aua.gr/login - noc.aua.gr DN
Aristotle University of Thessaloniki - https://www.it.auth.gr/saml_login?custom_return=eForms%2Faai - ldap.auth.gr DN: o=auth,c=GR
Athens University of Economics and Business - https://sso.aueb.gr/login
Athens school of fine arts - https://sso.asfa.gr/login
Democritus University of Thrace - https://login.duth.gr
Harokopio University - https://sso.hua.gr/login
Hellenic Open University - https://login.eap.gr/idp/Authn/UserPassword
International Hellenic University - http://sso.ihu.edu.gr/idp/
Ionian University - https://sso.ionio.gr/login
National Technical University of Athens - https://login.ntua.gr/idp/Authn/UserPassword
@basharovV
basharovV / https_nginx_express_node_config.md
Last active October 31, 2023 15:11
How to configure HTTPS with Lets Encrypt, Nginx reverse proxy, Express and Node

How to configure HTTPS with Lets Encrypt, Nginx reverse proxy, Express and Node

  1. Have a Node app ready for production.
  2. Create an app.js file in your project directory:
const express = require('express');
const path = require('path');
const app = express();

// Allow dotfiles - this is required for verification by Lets Encrypt's certbot
@johnhw
johnhw / umap_sparse.py
Last active January 6, 2024 16:09
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random