Skip to content

Instantly share code, notes, and snippets.

View PexMor's full-sized avatar

PexMor PexMor

  • Prague, CZ, Europe
View GitHub Profile
@PexMor
PexMor / test.c
Created March 5, 2019 09:31
Some nice description
#include <stdio.h>
#include <string.h>
#define BSIZE 200
void main(void) {
char ibuf[BSIZE];
char obuf[BSIZE];
bzero(ibuf,BSIZE);
@PexMor
PexMor / test.c
Created March 5, 2019 09:31
Some nice description
#include <stdio.h>
#include <string.h>
#define BSIZE 200
void main(void) {
char ibuf[BSIZE];
char obuf[BSIZE];
bzero(ibuf,BSIZE);
@PexMor
PexMor / cloud-init.md
Last active April 29, 2018 19:29
Debian and Centos cloudimage start

Cloud init

The CI has two important files meta-data and user-data. Examples to be seen below.

config/meta-data

instance-id: iid-cloud-234567
local-hostname: xcloud-234567
@PexMor
PexMor / netrc-howto.md
Last active April 11, 2018 09:10
.netrc howto

Github:bagder/everything-curl

.netrc

Unix systems have for a very long time offered a way for users to store their user name and password for remote FTP servers. ftp clients have supported this for decades and this way allowed users to quickly login to known servers without manually having to reenter the credentials each time. The .netrc file is typically stored in a user's home directory. (On Windows, curl will look for it with the name _netrc).

@PexMor
PexMor / index.js
Last active December 9, 2022 17:15
Google OAuth2 in nodejs/express example
'use strict';
const express = require('express');
const simpleOauthModule = require('simple-oauth2');
const hd = require('os').homedir();
const cfg = require(hd+'/.thinx.json');
const https = require('https');
const app = express();
const oauth2 = simpleOauthModule.create({
@PexMor
PexMor / mkExample.sh
Last active October 26, 2017 08:54
The CSR generation - script to make Certificate Signing Request using the openssl and bash
#!/bin/bash
source mkFce.inc
ODIR=example
ORG="The Random House"
EMAIL=info@random.org
TEAM="The best team"
DOMAIN=the.best.com
@PexMor
PexMor / trgIpTest.sh
Created October 11, 2017 10:46
This is a test script to be used on machines that might have some trouble getting to target ip through firewall, thus providing troubleshooting info
#!/bin/bash
# little test script to print whether target is reachable via ip and port combination
# in case that port is ommited then prints the routing path and gw
# default ip for internet connectivity test
TRGHOST=8.8.8.8
LANG=en
TIMEOUT_SECONDS=1
# usage:
@PexMor
PexMor / mkVethExample.sh
Last active January 18, 2017 07:18
Example showing how to interconnect two docker containers using veth (while running)
#!/bin/bash -x
D1NAME=u1
D2NAME=u2
INAME=alpine
docker kill $D1NAME
docker kill $D2NAME
docker rm $D1NAME
docker rm $D2NAME