Skip to content

Instantly share code, notes, and snippets.

View axilleas's full-sized avatar
🏠
Working from home

Achilleas Pipinellis axilleas

🏠
Working from home
View GitHub Profile
@axilleas
axilleas / perm.rb
Last active February 5, 2022 10:42
Permutations of a string
#!/usr/bin/env ruby
# Recursive method, print all strings permutations with length = str.length.
# Iterrate over each character of given string and recursively call
# string_permutations. Each time, a letter from str is stripped and added to elmt.
# When str.length reaches zero, print elmt.
def string_permutations(str, elmt='')
if str.length == 0
p [elmt]
else
@axilleas
axilleas / archgitlab.sh
Last active March 29, 2021 11:53
Install GitLab 5.0 on Archlinux
#!/bin/bash
##########################
## Check if run as root ##
##########################
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@axilleas
axilleas / reset.md
Created March 18, 2021 22:05 — forked from hitautodestruct/reset.md
Reset root password on scaleway.com
@axilleas
axilleas / coordinate.py
Created March 30, 2013 21:20
Edx - 6.00x Lecture 10 Problem 7
class Coordinate(object):
def __init__(self,x,y):
self.x = x
self.y = y
def getX(self):
# Getter method for a Coordinate object's x coordinate.
# Getter methods are better practice than just accessing an attribute directly
return self.x
@axilleas
axilleas / ddns-start
Created July 12, 2020 12:08 — forked from ql-owo-lp/ddns-start
Asus-Merlin-DuckDNS
#!/bin/sh
# register a subdomain at https://www.duckdns.org/ to get your token
# put 'hostname|token' in the 'Host Name' field under DDNS
# e.g. myhost|abcdefgh-1234-5678-9876-f71b0ed7a7fe
DDNS_HOSTNAME_FIELD=$(nvram get ddns_hostname_x)
SUBDOMAIN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $1}')
TOKEN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $2}')
IPV4=$(nvram get wan0_ipaddr)
@axilleas
axilleas / portainer-dokku.md
Created May 12, 2018 08:01 — forked from woudsma/portainer-dokku.md
TLS secured TCP exposed Docker daemon on Dokku host - setup

TLS secured TCP exposed Docker daemon on Dokku host - setup

  1. Create certificates
  2. Edit Docker options
  3. Restart Docker
  4. Copy client certificates from host
  5. (optional) Add remote endpoint in Portainer

Create certificates:

Log into Dokku host as root and create server/client certificates:

Keybase proof

I hereby claim:

  • I am axilleas on github.
  • I am axil (https://keybase.io/axil) on keybase.
  • I have a public key ASDBdLEYIKRI_WjBtF-KXqDyx7JQgnRHCKVGtU2d16hlCwo

To claim this, I am signing this object:

@axilleas
axilleas / cron_helper.sh
Last active October 26, 2017 00:37 — forked from liquidgecka/cron_helper.sh
Cron helper
#!/bin/bash
usage() {
cat << EOF
Usage: $0 [OPTION]... COMMAND
Execute the given command in a way that works safely with cron. This should
typically be used inside of a cron job definition like so:
* * * * * $(which "$0") [OPTION]... COMMAND
Arguments:
@axilleas
axilleas / Dockerfile
Created November 12, 2015 19:02 — forked from eluleci/Dockerfile
Dockerfile for Android CI
############################################################
# Dockerfile to build Android project and use Jenkins CI
#
############################################################
FROM ubuntu:14.04
MAINTAINER eluleci <emrullahluleci@gmail.com>
RUN apt-get update
@axilleas
axilleas / Advantages.md
Created August 30, 2017 08:58
Comparison of Git with CVS and Git Overview

Git vs. CVS Advantages

Flexible Workflow

In Git your working copy is a clone of the entire repository. This includes branches and tags. This decreases the overhead (speed and manual work) involved when switching contexts and the need to be connected to a network. Some examples are:

  • When switching branches there is no need to connect to a remote server or close your IDE/project and open a checkout in another directory. Running git checkout [branch name] is all you need to do.
  • When merging you do not need a connection to the remote server, you have all branches locally. Since branches are so cheap in Git you could create a new branch to perform the merge in so that if you had a large amount of conflicts you could incrementally work on and commit without affecting the main branch then merge or create a patch after everything has been fixed.
  • Because Git is a distributed system in addition to connecting to a central repository developers can connect to another developers repository. This allows team