Skip to content

Instantly share code, notes, and snippets.

View andmarios's full-sized avatar

Marios Andreopoulos andmarios

View GitHub Profile
@andmarios
andmarios / hc.sh
Created April 14, 2019 23:10
Script to control battery charge and fn lock for Matebook X Pro. Requires vim (xxd), hexdump, dd, ec_sys module and bash.
#!/usr/bin/env bash
help() {
cat <<EOF
Options:
- cc-disable
Disable charging control
- cc-home
Charging control to Home mode (40%-70%)
- cc-work
@andmarios
andmarios / gitlab
Last active July 24, 2019 07:19
Gitlab 4.1 init script for Gentoo Linux
#!/sbin/runscript
# GitLab 4.1 init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/gitlab/gitlab
GITLAB_USER=gitlab
depend() {
need net redis
}

Keybase proof

I hereby claim:

  • I am andmarios on github.
  • I am andmarios (https://keybase.io/andmarios) on keybase.
  • I have a public key whose fingerprint is 40D8 9BF3 3051 995B CA92 3BAC 4409 4792 7D87 B5DB

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am andmarios on github.
  • I am andmarios (https://keybase.io/andmarios) on keybase.
  • I have a public key ASCY1o5xl79EIlqzXKc5UmyF9LLMjmvRk3RiNoWVmactOAo

To claim this, I am signing this object:

@andmarios
andmarios / gitlab
Created July 8, 2013 21:05
Gentoo init script for Gitlab versions 5.2 and 5.3
#!/sbin/runscript
# GitLab 5.2 and 5.3 init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/git/gitlab
GITLAB_USER=git
depend() {
need net redis
}
@andmarios
andmarios / gollum
Created November 27, 2012 03:45
Gollum wiki init script for Gentoo Linux
#!/sbin/runscript
# Gollum init script for Gentoo Linux
GOLLUM_BASE=/home/wiki/OurWiki
GOLLUM_USER=wiki
GOLLUM_USER_HOME=/home/wiki
depend() {
need net
}
#!/bin/bash
# Marios Andreopoulos, 2015
# A very simple bash script that goes into a git directory, counts lines of code
# for a certain language and each commit and creates a plot.
# $1 is path to git repository, $2 is language name as supported by cloc (e.g Go, Bourne Shell)
# bash linesPerCommitPlot.sh my-repo Go
# NEVER run it in your work directory. Make a temporary clone and use it there.
@andmarios
andmarios / gist:45073a53c408091e6dce
Last active August 29, 2015 14:08
Replace container IDs with container IPs for `docker ps`
#!/usr/bin/env bash
docker ps | while read DLINE
do
CONTAINER="$(echo $DLINE | grep -Eo "^[a-f0-9]{12,12}")"
[[ ! -z "$CONTAINER" ]] && CIP="$(docker inspect $CONTAINER | grep IPAd | cut -d \" -f 4)"
echo "$DLINE" | sed -e "s/[a-f0-9]\{12,12\}/$CIP/"
done