Skip to content

Instantly share code, notes, and snippets.

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

Konstantinos Sofokleous ksophocleous

🏠
Working from home
View GitHub Profile
@ksophocleous
ksophocleous / install
Last active December 26, 2015 07:49
avconv + gstreamer 1.0
#!/bin/bash
sudo apt-get install -y libav-tools
sudo add-apt-repository -y ppa:gstreamer-developers/ppa
sudo apt-get -y update
sudo apt-get -y install gstreamer1.0*
@ksophocleous
ksophocleous / sh_example_1.sh
Created February 18, 2014 09:50
so much (ba)sh awesomeness in this script
#!/bin/sh
if [ $# -lt 1 ]; then
echo "No destination defined. Usage: $0 destination" >&2
exit 1
elif [ $# -gt 1 ]; then
echo "Too many arguments. Usage: $0 destination" >&2
exit 1
elif [ ! -d "$1" ]; then
echo "Invalid path: $1" >&2
@ksophocleous
ksophocleous / kickstart
Created June 3, 2014 07:57
kickstart_instance
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y build-essential fish
@ksophocleous
ksophocleous / fake_webcam.sh
Last active August 29, 2015 14:02
firefox on ubuntu server
#!/bin/bash
set -e
# Assumes that you run update_kernel.sh (another gist of mine)
# export URL=url to open (e.g. http://54.195.58.117/webrtc.html?port=8801)
# export VIDEODEV=video device to send test video stream to (e.g. /dev/video0)
if [ -z "$URL" ]; then
@ksophocleous
ksophocleous / update_kernel.sh
Last active August 29, 2015 14:02
update kernel on EC2 precise to 3.2.59 (32bit)
#!/bin/bash
# NOTE: This was tested on ami-06d12671
set -e
sudo apt-get update --fix-missing
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
@ksophocleous
ksophocleous / install_jekyll.sh
Created September 8, 2014 07:21
install jekyll
sudo apt-get update
sudo apt-get install -y ruby1.9.1 ruby1.9.1-dev nodejs gcc build-essential g++ make
sudo gem install jekyll
@ksophocleous
ksophocleous / unix_timestamp.cpp
Created September 8, 2014 12:20
cross platform unix timestamp in c++
#include <iostream>
#include <chrono>
int main(int argc, char *argv[])
{
auto tp = std::chrono::system_clock::now();
auto dur = tp.time_since_epoch();
auto seconds = std::chrono::duration_cast<std::chrono::seconds>(dur).count();
@ksophocleous
ksophocleous / keybase.md
Created September 23, 2014 10:37
public keybase proof

Keybase proof

I hereby claim:

  • I am ksophocleous on github.
  • I am ksophocleous (https://keybase.io/ksophocleous) on keybase.
  • I have a public key whose fingerprint is FD3E 0ECE F582 F6FB 60EF 2C24 9B0D 6DDE FC49 7B15

To claim this, I am signing this object:

@ksophocleous
ksophocleous / Vagrantfile
Last active August 29, 2015 14:07
my usual Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "kostas"
config.vm.box_url = "https://kostas.io/kostas.box"
config.ssh.username = "kostas"
@ksophocleous
ksophocleous / gst-14-installer.sh
Last active August 29, 2015 14:08
gstreamer and plugins 1.4.4
#!/bin/bash
set -e
cd $HOME
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
apt-get update