Whenever your movie’s list disappears its quite easy to recover:
pi@raspberrypi ~ $ sudo rm /var/lib/minidlna/files.db
pi@raspberrypi ~ $ sudo service minidlna restart
[ ok ] Restarting DLNA/UPnP-AV media server: minidlna.
Whenever your movie’s list disappears its quite easy to recover:
pi@raspberrypi ~ $ sudo rm /var/lib/minidlna/files.db
pi@raspberrypi ~ $ sudo service minidlna restart
[ ok ] Restarting DLNA/UPnP-AV media server: minidlna.
This tutorial is a quick way to understand how to add a script or something else to the Makefile installation process. This is solely for those who are building rpm/deb packages and want to add extra stuff in the installation package.
So inside your Makefile directory add the file you would like to see in the final installation:
For example:
[root@softether vpnserver_package]# ls script*
script_i_want_to_add.sh
Now edit Makefile to properly add the script to the final package.
[root@softether vpnserver_package]# vim Makefile
Look for the install and uninstall part and add the lines you need.
install: | |
cp vpncmd/vpncmd /usr/bin/ | |
cp vpncmd/ham* /usr/bin/ | |
cp -r vpnserver /usr/local/ | |
chmod 755 vpnserver | |
cp vpnserver.init /etc/init.d/vpnserver | |
cp vpn_server.config /usr/local/vpnserver/ | |
chmod 755 /etc/init.d/vpnserver | |
/sbin/chkconfig –add vpnserver | |
### adding install line here | |
cp script_i_want_to_add.sh /usr/bin | |
uninstall: | |
rm -rf /usr/local/vpnserver | |
#rm -f /etc/init.d/vpnserver | |
/sbin/chkconfig –del vpnserver | |
rm /usr/bin/hamco* | |
rm /usr/bin/vpncmd | |
### adding uninstall line here | |
rm /usr/bin/changevhub |
And that’s it. This script will then be accessible in the final stage of the installation, under /usr/bin/ folder which is the PATH folder.
This WebCrawler will be made in Python using Beautiful Soup. It will simple collect data form a webpage and store every “href” inside that webpage. In order to work you must install python and BS. Normally Python should be installed already so theres BeautifulSoup missing.
yum install python-BeautifulSoup.noarch
Afterwards all you need is to make a file program.py and save this source in it.
#!/usr/bin/python import urllib2,os,sys import BeautifulSoup if len(sys.argv) > 1 : origin_url = str(sys.argv[1]) else : # Must have http:// origin_url = "http://www.stupidness.com/" request = urllib2.Request(origin_url) response = urllib2.urlopen(request) soup = BeautifulSoup.BeautifulSoup(response) href_array=[] for a in soup.findAll('a'): link=a['href'] if len(link) > 0 : if 'http://' in link : href_array.append(a['href']) else : href_array.append(os.path.dirname(origin_url)+a['href']) print href_array
With this simple scraper/crawler you will get any href from a webpage.
To use this just type
python program.py
This a quick and dirty solution to stream from a Decklink Recorder card (i.e. blackmagic capture board) using ffmpeg. In my case I used an old Ubuntu 11.10 and installed all debians provided by Blackmagic and FFMpeg/avconv. There should be no secret installing those.
I also used the bmdtools git project. This is the best project to make sure your blackmagic board is working.
Requisits:
Comand line
./bmdcapture -m 13 -C 1 -V 3 -F nut -f pipe:1|ffmpeg -i - -q 5 -r 25 -f mpegts udp://10.0.0.4:5010
bmdtools
ffmpeg
This is the quickest way to stream your capture video/audio. For a long term solution I would suggest capturing and streaming using VLC.
For localhost development, I needed subdomains to work dynamically. Unfortunately you /etc/hosts file doesn’t recognize subdomain wildcards. There’s a great tutorial here that provided the solution I needed for my system Ubuntu 12.04 LTS.
Here’s a handy terminal command that will drop all tables in a mysql database
mysql -u root -Nse "show tables" DATABASE_NAME | while read table; do mysql -u root -e "drop table $table" DATABASE_NAME;done
And then the import command from a .sql file
mysql -u root DATABASE_NAME < /path/to/file.sql
In this first post I’ll be using the upstart configuration to easily manage a DLNA server in a Ubuntu desktop/server.
For starters I really don’t know exactly how DLNA works but it doesn’t matter, my TV and my Android do so that’s enough for me. I tried a bunch of DLNA servers, but the easiest one proved to be minidlna.
Upstart is a great tool to manage boot services (previously /etc/init.d/ !?) or to start/stop any service in a really simple and effective way.
For example starting a service will be as easy as writing in a terminal:
start dlna
So for starters you will need to install minidlna. Use Ubuntu software center to look for it or just type
sudo apt-get install minidlna
The only change I did to /etc/minidlna.conf was this one
media_dir=V,/home/myuser/Videos
Afterwords you need to create the file /etc/init/dlna.conf and type this into that file.
# rc - System V runlevel compatibility # # This task runs the minidlna service when filesystem and nic are availabe description "MiniDLNA controller" author "Nuno Mota <nrmmota@gmail.com>" start on filesystem and net-device-up IFACE=eth0 stop on runlevel [!$RUNLEVEL] expect fork exec minidlna -f /etc/minidlna.conf
And that’s it. Whenever you boot your machine the service will be imediatly available. If for some reason the process dies, upstart will start it again. Everything is logged in syslog.
Given I login as "student" And I go to "/calendar/index" When I mouseover "#credits_count" Then I should see "Remaining rescheduling credits = 3" And I should see "47" in the "#credits_count" element
Chrome wasn’t showing up on Sahi as a browser option on Ubuntu 12.04 LTS.
To make this work open up Sahi, choose “Configure”, and edit the chrome <path> to:
... <path>/usr/bin/chromium-browser</path> ...
Had a problem in my VPS of the mysqld service spontaneously dying.
When I used the command:
sudo service mysqld status
I got a message saying, “mysqld dead but subsys locked”. I didn’t realise this machine didn’t have a swapfile, so in order to fix the problem I ran the following commands:
dd if=/dev/zero of=/swapfile bs=1M count=1024 mkswap /swapfile swapon /swapfile Open /etc/fstab and add this line /swapfile swap swap defaults 0 0