scuq's personal blog

open your eyes, open your mind

lions timemachine —

lion is a bit picky about where it’s timecapsules could be buried. at least if u don’t want to loose uptime. there are some “default write commands” and u could play with the DHCAST128 settings, but as i’ve figured out, free-nas afp shares are working like a charm.

 

 

let’s start time traveling …

 


launching a shell script with spotlight in osx —

create a shell script (for example in ~/Scripts) name it foo.command instead of foo.sh put your contents in, and use spotlight to find and open it.

for example start a remote streaming server via ssh and launch vlc to view the stream:

1
2
3
4
#!/bin/sh
ssh root@stream.example.org"/etc/init.d/streaming start"
sleep 1
open -a VLC --args http://stream.example.org:8080/stream/1

Xbmc Pulseaudio Switcher —

I’ve written this little script for xbmc, to switch between audio sources (creative xfi/nvidia hdmi/and both of them combined).

pa_switch_sinks.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/python
# pa_switch_sinks.py - (c) scuq 2011
# v0.1
# switches pulse audio sinks for xbmc
# I used it to switch between analog sound output with
# my usb creative xfi, the hdmi audio of my nvidia 430
# and a simultaneous output to both
# i've tested this with ubuntu (11.10)
##
## /etc/pulse/default.pa:
##
## load-module module-alsa-sink device=surround51:CARD=S51,DEV=0 sink_name=xfi
## load-module module-alsa-sink device=hdmi:CARD=NVidia,DEV=0 sink_name=hdmi
## load-module module-combine sink_name=xfi_and_hdmi slaves=xfi,hdmi adjust_time=3
##
#
## xbmc-keybinding: ~/.xbmc/userdata/keymaps/keyboard.xml
##
##
##
##XBMC.RunScript(special://home/scripts/pa_switch_sinks.py,-shortcut)
import re
from subprocess import Popen, PIPE, STDOUT
import sys
import logging
from logging.handlers import SysLogHandler
logger = logging.getLogger('pa_switch_sinks.py')
logger.setLevel(logging.INFO)
syslog = SysLogHandler(address='/dev/log')
formatter = logging.Formatter('%(name)s: %(levelname)s %(message)s')
syslog.setFormatter(formatter)
logger.addHandler(syslog)
# list of sinks (see example at the top)
sinks=["xfi", "hdmi", "xfi_and_hdmi"]
sinks_count = len(sinks)-1
# trim function
def retrim(inputstr):
inputstr = re.sub("^[^\w]+","",inputstr)
inputstr = re.sub("[^\w]+$","",inputstr)
inputstr = re.sub(" +"," ",inputstr)
return inputstr
# simple wrapper for Popen
def execute(command):
p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
stdOut=re.sub('\\n+','\\n',str(p.stdout.read().decode("utf-8"))).split("\n")
stdErr=str(p.stderr.read()).split("\n")
return stdOut, stdErr
# get the current default sink
current_default_sink_out, current_default_sink_err = execute('pactl stat | grep "Default Sink" | sed s\'/Default Sink: //\'')
current_default_sink = current_default_sink_out[0]
# get a list of pulseaudio clients
current_clients_out, current_clients_err = execute('pactl list clients')
# "parse" the client list and try to find xbmc
xbmc_pulse_client_num=0
last_found_client_num=0
for line in current_clients_out:
if line.startswith("Client #"):
last_found_client_num=retrim(line.replace("Client #",""))
if line.count("xbmc") > 0:
xbmc_pulse_client_num=last_found_client_num
# determine next sink from the sink list
next_sink=""
next_sink_index=0
print sinks.index(current_default_sink)
print sinks_count
if sinks.index(current_default_sink) != sinks_count:
next_sink_index=sinks.index(current_default_sink)+1
next_sink=sinks[next_sink_index]
logger.info(current_default_sink+"->"+next_sink)
# set the new default sink
std, err = execute('pacmd set-default-sink '+next_sink)
# move the xbmc client to the new default sink
if xbmc_pulse_client_num != 0:
xbmc_sink_change_out, xbmc_sink_change_err = execute('pactl move-sink-input '+xbmc_pulse_client_num+' '+next_sink)

the world is changing, I feel it in the … —

“the world is changing,
I feel it in the water,
I feel it in the earth,
I see it in these days certificate handling,
because I had to supply a pkcs12 file two times in the last
few days (sslexplorer/adito, cyanogenmod-openvpn) here is the command to
convert
easy-rsa created certificate/key/ca files to an pkcs12 – p12 file:

ca certifcate: ca.crt
client certificate: example.abyle.org.crt
client private key: example.abyle.org.key

openssl pkcs12 -export -in example.abyle.org.crt -inkey
example.abyle.org.key -certfile ca.crt -name ”

googleplus-image-1

published with google+ by Stefan Nistelberger (Google+)


Export pfx to x509 cert and key files —

If you have an password protected pfx-file and you need a x509-certificate and an unprotected key-file you can convert it with these openssl commands

Certificate:

openssl pkcs12 -in star_example.org.pfx -out star_example.org.cert -nokeys -clcerts

Key:

openssl pkcs12 -in star_example.org.pfx -out star_example.org_with-password.key -nocerts
openssl rsa -in star_example.org_with-password.key -out star_example.org.key


npy – A Python Network Script —

ein wenig Doku ist jetzt schon online, auf deutsch.

http://wiki.abyle.org/doku.php?id=a_python_network_script_-_npy.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Options:
h, −−help show this help message and exit
s IPSOURCE, −−ip-source=IPSOURCE
get the ipv4 addresses from this source: e.g.: ek,file
,cli-argument
a IPADDRESS, −−address=IPADDRESS
specify ipv4 address
j JOB, −−job=JOB which job to execute, e.g. backup, passwordchange
o JOBDIR, −−job-dir=JOBDIR
location of the job directory
(default=/data/scripts/generic/npy/jobs)
p JOBPROTOCOLTYPE, −−job-protocol-type=JOBPROTOCOLTYPE
the protocol used to do the job, e.g.: snmpv2, telnet,
ssh, snmpv3 (default=snmpv2)
t DEVICETYPE, −−type=DEVICETYPE
suggested device type e.g. ES470,ERS8000, see -l for
known device-types
l, −−list-device-types
list known device-types
A, −−ascent-mode switch to integrated ascend mode this overwrites
device_access, location and source parameter
L LOCATIONAURAS, −−location-auras=LOCATIONAURAS
comma seperated list of loc_auras in ascent db, used
to specify location e.g. graz
U AURAS, −−auras=AURAS
comma seperated list of auras in ascent db, e.g.
core,wireless,access
f SECONDBYTEFILTER, −−second-byte-filter=SECONDBYTEFILTER
filter addresses by this second byte of an IPv4
address (default=all)
d DEVICEDEFINITIONFILE, −−device-definition-file=DEVICEDEFINITIONFILE
location of the devicedefinitionfile (default=/data/sc
ripts/generic/npy/device_definition.xml)

Simple Syslog Client for Windows (sslog) —

I’ve created a syslog-client out of some code I’ve found with google. this client is able to send a syslog message to a remote syslog server, it’s designed for logging an startup/logon/logout/shutdown event of a windows client machine (tested on xp@32bit, 7@32bit and 7@64bit) but you can send any string with a max. length of 25.
The default syslogserver is set to sslog not full qualified, so if you are able to set an dns cname alias to sslog for your central syslogserver the parameters which are needed to be passed are very small indeed.

e.g. logon event logging:

sslog -e LOGIN

you can also download the code and the binary at google code (http://code.google.com/p/sslog/).

feel free to submit patches.

Download v0.2.


Vizyon 820HD/Ipbox 910HD/Cuberevo Mini —

As I’ve mentioned in the previous post, the AAF image is really nice, the picture quality is amazing with the default (not very good adjusted) tv settings of my toshiba 37Z3030D.

But after zapping arround we experienced freezes on SD channels, the time had come to get my by eye alignment of the dish fixed. But the things got worse, no chance to get the percent measurement scale of the enigma2 software over a stable 60 value on all channels.
After a complete relocation of the dish and after destroying one aluminium dish mount arm. (by squeezing it while angrily tighten the screws), the values on the new location where still unstable. The next source of trouble assumed, was the coax cable with the f-plug connectors. after hours of stripping with the wrong tools (a cutter, rusty pliers and a pair of scissors) the cable tails were fitting perfectly in the f-plugs, where they got stuck with an ultra sticky tape. :)

However, the problem persists.

After another google session, I found an explanation of the problem, on the italian forum of the sif-team, the guy who wrote the tuner driver writes:


That’s doesn’t mean it is a sharp tuner bug, it exists since the first version of enigma2 and it’s called: BUGGETTONE.
Holy shit, i’m really bored to say this every time! IT IS A GENERAL BUG, COMMON TO EVERY RECEIVER AND EVERY TUNER on cuberevo boxes!
When and only when i will find the bug you will see it fixed… all of you are going to make me angry!

The bug description by someone who made him angry :)


When switching from a dvb-s to dvb-s2 transponders no problems, but when switching from a dvb-s2 to dvb-s transponder instability occurs in the signal quality and micro friizing. At switch off the receiver in standby mode and switch on again the problem disappears.

At least my satellite equipment is clean and well aligned now. :)