Skip to content

Instantly share code, notes, and snippets.

Avatar

Marios Andreopoulos andmarios

View GitHub Profile
@andmarios
andmarios / hc.sh
Created Apr 14, 2019
Script to control battery charge and fn lock for Matebook X Pro. Requires vim (xxd), hexdump, dd, ec_sys module and bash.
View hc.sh
#!/usr/bin/env bash
help() {
cat <<EOF
Options:
- cc-disable
Disable charging control
- cc-home
Charging control to Home mode (40%-70%)
- cc-work
View keybase.md

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:

View keybase.md

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:

View linesPerCommitPlot.sh
#!/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 Aug 29, 2015
Replace container IDs with container IPs for `docker ps`
View gist:45073a53c408091e6dce
#!/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
@andmarios
andmarios / gitlab
Created Jul 8, 2013
Gentoo init script for Gitlab versions 5.2 and 5.3
View gitlab
#!/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 / gitlab
Last active Jul 24, 2019
Gitlab 4.1 init script for Gentoo Linux
View gitlab
#!/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
}
@andmarios
andmarios / gollum
Created Nov 27, 2012
Gollum wiki init script for Gentoo Linux
View gollum
#!/sbin/runscript
# Gollum init script for Gentoo Linux
GOLLUM_BASE=/home/wiki/OurWiki
GOLLUM_USER=wiki
GOLLUM_USER_HOME=/home/wiki
depend() {
need net
}