Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Kristof theriverman

🎯
Focusing
  • Hungary
Block or report user

Report or block theriverman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@theriverman
theriverman / README.md
Last active Jul 7, 2019
Full Stack Development with VSCode with Remote-SSH
View README.md

Full Stack Development with VSCode with Remote-SSH

Motivation

With the latest version of Visual Studio Code it's now possible to remotely connect to a Linux host over SSH and gain a full access to it. One can access all files and access the shell within the IDE just like the user were working directly on the remote HOST.

Users can conveniently forward local ports to the remote Host, that is, services running on the remote host can be accessed using the local computer.

In case the user is a full-stack developer, for example, developing with Angular 2/x and Django, the user is probably running the following commands:

  • ng serve (Listens on localhost:4200)
@theriverman
theriverman / find_keys_in_dict.py
Last active Feb 11, 2019
Recursively find keys in Python dictionary
View find_keys_in_dict.py
def find_keys(dictionary: dict, key_name: str) -> list:
keys_list = []
def dict_recurse_search(_wh):
for k, v in _wh.items():
if k == key_name:
[keys_list.append(x) for x in v]
if isinstance(v, dict):
dict_recurse_search(v)
else:
continue
@theriverman
theriverman / getUserPassword.hpp
Created Feb 11, 2019
C++ password prompt with stdin masking
View getUserPassword.hpp
/*
Example code: https://gist.github.com/theriverman/b41daa62f5013126b77790b8165fcf74
ORIGINAL LOCATION OF CODE SNIPPET:
https://stackoverflow.com/questions/1413445/reading-a-password-from-stdcin
Credits: https://stackoverflow.com/users/121961/vargas
*/
#ifdef WIN32
#include <windows.h>
@theriverman
theriverman / examplePasswordPrompt.cpp
Created Feb 11, 2019
C++ CLI Password Prompt Example
View examplePasswordPrompt.cpp
/*
For getUserPassword.hpp, see other gist.
Build: ++ examplePasswordPrompt.cpp -o examplePasswordPrompt
*/
#include <iostream>
#include <string>
#include "getUserPassword.hpp"
@theriverman
theriverman / python3_lync-sample1.py
Last active Mar 31, 2018 — forked from msmorul/lync-sample1.py
Example python3 script for authenticating to Lync and creating an application endpoint that lists all of a persons contacts. Python example for what's described here https://ucwa.lync.com/documentation/keytasks-createapplication
View python3_lync-sample1.py
import requests
import json
from urllib.parse import urlparse
sip_domain = "SIP_DOMAIN.COM"
username = "USERNAME@SIP_DOMAIN.COM"
password = "YOUR_LYNC_PASSWORD"
def extract_auth_url(_string):
@theriverman
theriverman / adduser_pw.sh
Created Jul 3, 2017
Create user with password shell-script
View adduser_pw.sh
#!/bin/sh
# after `=` type the user account and password you wish to create respectively
user=your_selected_account_name
password=your_supersecret_password
adduser --quiet --disabled-password --shell /bin/bash --home /home/$user --gecos "User" $user
# set password
@theriverman
theriverman / common.py
Last active Jun 30, 2017
Postgresql Auto-fallback (initial)
View common.py
DATABASES = {
"follower": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "follower",
"USER": "root",
"HOST": "54.34.65.24",
"PORT": "3306",
},
"default": {
"ENGINE": "django.db.backends.postgresql",
@theriverman
theriverman / default.conf
Created Jun 17, 2017
Etherpad behind nginx served at /etherpad
View default.conf
server {
...
...
...
# ETHERPAD|Reverse Proxy [/etherpad]
location /etherpad/ {
rewrite /pad/(.*) /$1 break;
rewrite ^/pad$ /pad/ permanent;
proxy_pass http://localhost:9001/;
@theriverman
theriverman / torrent.conf
Created Jun 17, 2017
Transmission WebUI behind nginx proxy
View torrent.conf
server {
listen 80;
server_name torrent.domain.com;
location / { proxy_pass http://localhost:9091; }
}
@theriverman
theriverman / deploy_etherpad_mysql_ubuntu.txt
Last active Mar 24, 2017
Complete deployment of Etherpad with MySQL on Ubuntu 16.04 [2017]
View deploy_etherpad_mysql_ubuntu.txt
# It is implied that mySQL is already installed
# [you can try with postgresql, but I had issues with it recently.
# it seems like there's a bug with node-pg, probably]
# It is implied that node/nodejs is already installed!!
# To check your node/nodejs version issue:
# sudo node -v && nodejs -v && echo "Your returned values shall be v.6.10.0 or higher(preferably) for both values!"
# It is implied that npm is installed along with node/nodejs as well
---------------------------------------------------------------------
#Log on as root:
You can’t perform that action at this time.