Asterisk Blacklist Hobby webbhotell


sasc-ng – install

Filed under: Server — Mathz @ 15:52

Install SASC-NG
From Dolot
Jump to:navigation, search

Read the *old* tutorial here: Install Open-SASC-NG

Open-SASC-NG is dead, long live vdr-SASC-NG! Development on open-sasc-ng has halted a long time ago.

* 1 Introduction
* 2 Preparation
o 2.1 Got root?
o 2.2 Installing dependencies
* 3 Installing sasc-ng
o 3.1 Getting sasc-ng source
o 3.2 Patching the source
o 3.3 Configuring and compiling
o 3.4 Loading the modules
o 3.5 Loading at boot
o 3.6 Starting sasc-ng
* 4 Cleaning up
o 4.1 Moving files & folders
o 4.2 Init script
* 5 Additional files
* 6 Other Tutorials

1 Introduction

SASC-NG is a so called “softcam”. It’s a piece of software which is able to decode satellite feeds.

This can be useful in multiple cases:

* When your DVB-S(2) device does not have a CI
* When you just don’t want to buy a CI & CAM (since it is quite expensive)
* When you want to share a card over multiple tuners in your system (Perfectly legal, although it may be a breach of contract with your provider)
* When you want to participate in cardsharing over the internet (this is, err, less legal)

2 Preparation
2.1 Got root?

Installing everything is much easier when you’re root.

sudo -s

2.2 Installing dependencies

The following packages are needed to compile sasc-ng.

apt-get install linux-headers-`uname -r` build-essential subversion openssl gettext libssl-dev screen mercurial

3 Installing sasc-ng
3.1 Getting sasc-ng source

cd /usr/local/src
hg clone
cd /usr/local/src/sc
chmod +x contrib/sasc-ng/configure
chmod +x contrib/sasc-ng/dvbloopback/module/

3.2 Patching the source

This repository shouldn’t need any patches at the time.
3.3 Configuring and compiling

Do not use –shared! It will cause segfaults. Should you do use it, you’ll have to remove your sc folder and try again. (There’s no “make clean” here)

cd /usr/local/src/sc/contrib/sasc-ng/
make module

Installing the dvbloopback module (so it can load at boot)

rm /lib/modules/`uname -r`/misc/dvbloopback.ko
cd /usr/local/src/sc/contrib/sasc-ng/
cp sasc-ng /usr/bin
cp /usr/local/src/sc/contrib/sasc-ng/sc/PLUGINS/lib/* /usr/lib/
mkdir /lib/modules/`uname -r`/misc
/usr/bin/install dvbloopback.ko /lib/modules/`uname -r`/misc/

3.4 Loading the modules

since we installed the module at the appropriate position we can modprobe it:

modprobe dvbloopback

If you have multiple adapters (like I do, the reason why I’m using sasc-ng) you need to specify the amount of adapters you have. I have 3 adapters, so I do:

modprobe dvbloopback num_adapters=3

For some reason I’m constantly getting segfaults on Ubuntu (it doesn’t matter what kernel I’m using), but not on Debian.
3.5 Loading at boot

I used to advise you to add a line to your /etc/modules file to load the module at boot. This is no longer necessary with the new runsasc script (which you can find below.) In fact, removing it (therefore putting the script in charge of loading the module) resolved a few headaches for me.
3.6 Starting sasc-ng

To start sasc-ng:

LD_LIBRARY_PATH=/usr/local/src/sc/contrib/sasc-ng/sc/PLUGINS/lib/ ./sasc-ng -j 0:1 –cam-budget

To use it with MythTV:

LD_LIBRARY_PATH=/usr/local/src/sc/contrib/sasc-ng/sc/PLUGINS/lib/ ./sasc-ng -j 0:1 –cam-budget –sid-allpid –sid-nocache

LD_LIBRARY_PATH=/usr/local/src/sc/contrib/sasc-ng/sc/PLUGINS/lib/ ./sasc-ng -j 0:3 -j 1:4 -j 2:5 –cam-budget –sid-nocache -d 0xf0a –cam-dir /etc/camfiles

To use sasc-ng with newcs, add:



4 Cleaning up
4.1 Moving files & folders

We will give our camfiles (cardclient.conf) a proper home & copy sasc-ng to the binary folder.

mkdir /etc/camfiles
cd /usr/local/src/sc/contrib/sasc-ng/
mv sc_files/* /etc/camfiles/
cp sasc-ng /usr/bin/

Now we’ll move the needed library files to the correct place.

cp /usr/local/src/sc/contrib/sasc-ng/sc/PLUGINS/lib/* /usr/lib/

Now we’ll edit the startup files.

nano /usr/local/bin/runsasc

And paste this script (you can ignore the DRIVERDIR variable in this script. Since we copied the module to our kernel tree we can just “modprobe dvbloopback” without any path.) Pay attention to the number of adapters you’re loading! I’ve set it to 3 and have added the necessary “-j” options.


# Script to automate running of SASC-NG and Drivers

# Driver directory
# Path to SASC-NG binary
# Path to CAM Directory
# Number of DVB Cards you have in your system dedicated to SASC-NG
# Startup Options passed to SASC-NG. Adjust according to your devices.
#OPTIONS=”-r 0 -v 2 -o”
OPTIONS=”-j 0:3 -j 1:4 -j 2:5 –cam-budget –sid-allpid –sid-nocache –cam-dir”
# Number of times runsasc will attempt to restart SASC-NG after a crash has occured (set to 0 for no limit)
# Minimum runtime required (in seconds) for SASC-NG to continue restart attempts

## End Configuration Section ##

KILL=”/usr/bin/killall -q -TERM”

# Detect whether the DVBLooopback driver is already loaded
# and return 0 if it *is* loaded, 1 if not:
function DriverLoaded()
grep -qse dvbloopback /proc/modules

# Load all DVBLoopback driver modules needed for your hardware:
function LoadDriver()
modprobe dvbloopback num_adapters=$ADAPTERS
sleep 5

# Unload all DVBLoopback driver modules loaded in LoadDriver():
function UnloadDriver()
rmmod dvbloopback

# Load driver if it hasn’t been loaded already:
if ! DriverLoaded; then

LASTRESTART=$(date +%s)
while (true) do
if [ $LOOPCOUNT -le $MAXTRIES ] || [ $MAXTRIES -eq 0 ] ; then
eval “screen -D -m -S sasc-ng $SASCCMD &”
# Wait for SASC-NG to initialize then do rest
sleep 10
touch /tmp/SASC_COMPLETE
$KILL runsasc
# Remember PID of SASC-NG process
# Wait for SASC-NG to end or signal to arrive
wait $PID
# Remember return value of SASC-NG
if test $RET -eq 0 -o $RET -eq 2; then exit; fi
TIMEOFDEATH=$(date +%s)
if [ $TIMEOFDEATH -le $(($LASTRESTART + $MINRUN)) ] ; then
echo “`date` SASC-NG crashed in $RUNTIME seconds. Minimum required runtime for SASC-NG is $MINRUN seconds. Killing runsasc process…”
$KILL runsasc
echo “`date` Reloading DVBLoopback drivers”
$KILL sasc-ng
sleep 10
LASTRESTART=$(date +%s)
echo “`date` Restarting SASC-NG $LOOPCOUNT time(s). Maximum retries set to $MAXTRIES”

And give it the proper permissions:

chmod 755 /usr/local/bin/runsasc
chmod +x /usr/local/bin/runsasc

4.2 Init script

An init script will take care of sasc-ng starting up at boot.

nano /etc/init.d/sascd

Add these lines:

#! /bin/bash
# sasc start-stop script


test -f /etc/default/sascc && . /etc/default/sascc
test “$ENABLED” != “0” || exit 0

rm -f /tmp/SASC_COMPLETE

case “$1” in
if ! ps -C sasc-ng > /dev/null 2>&1; then
echo -e “Starting $DESC: $NAME. \n”
runsasc &
until [ -e /tmp/SASC_COMPLETE ] || [ $LOOP -eq $TIMEOUT ] ; do
sleep 1
if [ $LOOP -eq $TIMEOUT ]; then
echo -e “SASC-NG startup sequence has timed out in $TIMEOUT seconds. SASC-NG will not start. \n”
exit 1
echo -e “SASC-NG startup time was $LOOP second(s). \n”
echo -e “SASC-NG startup sequence completed. \n”
echo -e “SASC-NG is already running. \n”
if ps -C sasc-ng > /dev/null 2>&1; then
echo -e “Stopping $DESC: $NAME. \n”
sleep 3
killall -q -TERM $NAME
killall -q -TERM $DAEMON
sleep 5
rmmod dvbloopback.ko
echo -e “SASC-NG is not running. \n”
if ps -C sasc-ng > /dev/null 2>&1; then
echo -e “Restarting $DESC: $NAME. \n”
sleep 3
killall -q -TERM $NAME
killall -q -TERM $DAEMON
sleep 5
rmmod dvbloopback.ko
sleep 2
runsasc &
until [ -e /tmp/SASC_COMPLETE ] || [ $LOOP -eq $TIMEOUT ] ; do
sleep 1
if [ $LOOP -eq $TIMEOUT ]; then
echo -e “SASC-NG startup sequence has timed out in $TIMEOUT seconds. SASC-NG will not start. \n”
exit 1
echo -e “SASC-NG startup time was $LOOP second(s). \n”
echo -e “SASC-NG startup sequence completed. \n”
echo -e “SASC-NG is not running. \n”
echo “Use: $N {start|stop|restart|force-reload}” >&2
exit 1

rm -f /tmp/SASC_COMPLETE

exit 0

And now we set the proper permissions and actually add it to the runlevels:

chmod +x /etc/init.d/sascd
update-rc.d sascd defaults 21

We just need one more config file:

nano /etc/default/sascc

Add this:

# /etc/default/sascc
# Default SASC-NG startup config

# Change to 1 to enable sasc-ng’s init-script

# DVBLoopback Device creation timeout (in seconds)

5 Additional files

We’re planning on using this thing legally, with NewCS in our own system. We need a cardclient.conf file for that:

nano /etc/camfiles/cardclient.conf

And put this in it. (I added some more lines so you’ll get an idea as to how this thing works.)

# Comment lines can start with # or ;
# every client line starts with the client name, followed by some arguments:
# ‘hostname’ is the name of the server
# ‘port’ is the port on the server
# ’emm’ is a flag to allow EMM transfers to the server
# (0=disabled 1=enabled)
# ‘caid’ (optional) caid on which this client should work
# ‘mask’ (optional) mask for caid e.g. caid=1700 mask=FF00 would allow
# anything between 1700 & 17FF.
# Default is 1700 & FF00. If only caid is given mask is FFFF.
# You may give multiple caid/mask values comma separated
# (e.g. 1702,1722,0d0c/ff00).
# ‘username’ is the login username
# ‘password’ is the login password
# radegast client
# aroureos client
# ‘hexbase’
# ‘hexserial’ card data for which EMM updates should be send
# camd33 client (tcp protocol)
# ‘aeskey’ is the AES key (32bytes), disable encryption if missing
# camd35 client (udp protocol)
# cardd client
# buffy client
# ‘aeskey’ is the AES key (32bytes), disable encryption if missing
#some examples
# newcamd client
# ‘cfgkey’ is the config key (28bytes)
# gbox client
# NOTE: hostname & port will be ignore. GBOX must be runnning on the local
# machine. For convinience you should choose localhost:8004

6 Other Tutorials

* Install Gimp: Install and compile the latest GIMP from trunk (which has the single-window mode)

Retrieved from “”
Personal tools

* Log in / create account


* Page
* Discussion



* Read
* View source
* View history



* Main Page
* Recent changes
* Random page
* Help


* What links here
* Related changes
* Special pages
* Printable version
* Permanent link
* Browse properties

* This page was last modified on 25 November 2009, at 23:32.
* This page has been accessed 36 times.
* Content is available under Attribution-Share Alike 3.0 Unported.

* Privacy policy
* About Dolot
* Disclaimers

* Powered by MediaWiki
* Attribution-Share Alike 3.0 Unported


Ubuntu PXE

Filed under: Server — Mathz @ 15:11

cd /etc/initramfs-tools/
vim initramfs.conf
Edit BOOT=local to read BOOT=nfs

Before we update the init images, we should back up the current ones just so we can still get back into the local install if ever anything goes horribly wrong…

cd /boot
mv initrd.img-2.6.20-16-generic initrd.img-2.6.20-16-generic-OLD

Now we want to update the initramfs image:

update-initramfs -k all -c



Kannel install

Filed under: Server — Mathz @ 15:33

How to compile and install Kammel om Ubuntu:
sudo apt-get install make gcc libxml2 libxml2-dev mysql-server libmysql++-dev mysql-server mysql-client-5.0 phpmyadmin

./configure –with-mysql –enable-start-stop-daemon
sudo make install

Powered by WordPress