Skip to content

Instantly share code, notes, and snippets.

View maleficarum's full-sized avatar

Oscar Ivan maleficarum

View GitHub Profile
@maleficarum
maleficarum / aliasip.sh
Created February 15, 2012 19:46
Add/Remove alias for a given IP to localhost
ifconfig lo0 alias <IP>
ifconfig lo0 -alias <IP>
@maleficarum
maleficarum / keybase.md
Created September 19, 2017 03:27
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@maleficarum
maleficarum / etherAddress
Created September 16, 2017 15:47
etherAddress
0xacE3fFEb698769360D03c35431e00D3727aBf866
#include <Adafruit_NeoPixel.h>
#define PIN 6
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
import org.apache.commons.net.telnet.TelnetClient;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.net.ConnectException;
import java.net.UnknownHostException;
/**
* Execute a telnet connection to determine if the server and port are accessible.
*
@maleficarum
maleficarum / Telnet1.java
Created March 14, 2016 22:38
Telnet Java 1
Socket socket = new Socket("192.168.1.1", 23);
socket.setKeepAlive(true);
BufferedReader r = new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter w = new PrintWriter(socket.getOutputStream(),true);
int c=0;
while ((c = r.read()) != -1)
System.out.print((char)c);
w.print("1234\r\n"); // also tried simply \n or \r
@maleficarum
maleficarum / bluetooth.sh
Created January 5, 2014 04:58
Bluetooth push support for raspberry
hcitool scan
bluez-simple-agent hci0 MAC
bluez-test-device trusted MAC yes
apt-get install ussp-push
apt-get install obexd-server
apt-get install openobex-apps
@maleficarum
maleficarum / motion.sh
Created January 3, 2014 23:30
Motion setup on raspberry
sudo apt-get install rpi-update
sudo rpi-update
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install motion
@maleficarum
maleficarum / spotify_build.sh
Created December 9, 2013 18:38
Spotify for linux
# yum install wget rpmdevtools rpm-build yum-utils
$ rpmdev-setuptree
$ cd $(rpm --eval %_sourcedir)
$ wget http://leamas.fedorapeople.org/spotify/spotify-client.spec
$ spectool -g spotify-client.spec
# yum-builddep spotify-client.spec
$ env QA_RPATHS=2 rpmbuild -bb spotify-client.spec
@maleficarum
maleficarum / resize.sh
Created December 5, 2013 16:41
Resize disk using VBox and Linux SO
VBoxManage modifyhd OEL6-SOABPM-disk2.vdi --resize 250000
#Use gparted to resize and then ...
lvextend -L12G /dev/myvg/homevol
resize2fs /dev/myvg/homevol