Skip to content

Instantly share code, notes, and snippets.

View gabrik's full-sized avatar
🛰️
🦀

Gabriele Baldoni gabrik

🛰️
🦀
View GitHub Profile
@kanru
kanru / Android.mk
Created January 6, 2012 04:16
Android GPS using libhardware
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
gps_test.cpp
LOCAL_SHARED_LIBRARIES := \
libcutils libhardware
LOCAL_MODULE:= test-gps
@kylemanna
kylemanna / connmanctl.md
Last active June 27, 2023 23:12
Connmanctl Cheat Sheet
@scottslowe
scottslowe / lxc-template
Created November 25, 2013 19:59
This snippet of libvirt XML can be used as a template when creating LXC containers that you want to run/manage via libvirt.
<domain type='lxc'>
<name>REPLACE</name>
<memory>327680</memory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
@tamoyal
tamoyal / gist:10441108
Created April 11, 2014 04:39
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@KonradIT
KonradIT / readme.md
Last active September 25, 2023 01:55
GoPro Studio for Linux
@mash
mash / Makefile
Created November 4, 2014 09:59
udp server sample using libuv
LIBUV_HOME := $(HOME)/src/github.com/joyent/libuv
LIBUV := $(LIBUV_HOME)/build/Release/libuv.a
INC = $(LIBUV_HOME)/include
all:
gcc -o main -I$(INC) -Wall main.c $(LIBUV)
PHONY: all
@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@shakkhar
shakkhar / v4l2_capture.c
Last active April 25, 2024 03:25
Using Libav API to capture from V4L2 device. (This is based on doc/examples/demuxing_decoding.c from FFmpeg codebase. I had to modify it because FFmpeg does not ship with Ubuntu.)
/*
* Copyright (c) 2012 Stefano Sabatini
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active June 12, 2024 13:31
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@hongkongkiwi
hongkongkiwi / generate-ssh-key
Last active December 18, 2023 07:45
Simple one liner to generate an SSH key without a password in the default place with the comment as hostname then print out the public key for copy and paste.
HOSTNAME=`hostname` ssh-keygen -t rsa -C "$HOSTNAME" -f "$HOME/.ssh/id_rsa" -P "" && cat ~/.ssh/id_rsa.pub