Just another WordPress site

How to List A Directory Contents Using PHP (Recursive)

The code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 function listDirectory($path) { $handle = @opendir($path); while (false !== ($file = readdir($handle))) { if ($file == ‘.’ || $file == ‘..’) continue; if ( is_dir("$path/$file")) { echo "$path/$file\n"; listDirectory("$path/$file"); } else { echo "$path/$file\n"; } } closedir($handle); } [...]

faktyri

http://code.webface.bg/wfinvoice.html

Installing the drivers for an HP LaserJet 6P on Windows 7

From the time where printer manufacturers were still producing near indestructible models. Plus, 5 years on, and I’m still using the toner cartridge that came with the printer. Add an USB → IEEE1284 adapter, plug into a NAS or plug computer, and enjoy your network printer. Now, I did spend some time getting cups going, [...]

USB Audio on boot

/etc/modprobe.d/alsa-base.conf add: # Assign USB Audio as default sound card options snd_usb_audio index=-1 disable: # Keep snd-usb-audio from beeing loaded as first soundcard #options snd-usb-audio index=-2

Смяня енкодиг на фаилове с iconv

find -type f -iname ‘*.srt’ | while IFS= read -r; do iconv –from-code=cp1251 –to-code=UTF-8 "$REPLY" > "$REPLY"_tmp && mv — "$REPLY"_tmp "$REPLY" done

Автоматично рестартиане на mpg123 при разпадане на връзката

Една простотия която следи дали mpg123 натоварва процесора ако не натоварва процесора се предполага че връзката е разпадна и се рестартира програмата #!/bin/bash STREAMURL="http://193.108.24.21:8000/fresh" LOAD="40" PROGRAM="mpg123" PID=`pidof ${PROGRAM}` echo ${PID} if [ -e ${PID} ]; then #echo "mpg123 is not running" #echo "trying to start mpg123" mpg123 ${STREAMURL} & >/dev/null 2>&1 sleep 2 PIDNEW=`pidof ${PROGRAM}` [...]

Стартиране на линукс по мрежата

debootstrap –arch i386 wheezy /mnt/hdd5/32/wheezy http://ftp.bg.debian.org/debian debootstrap –arch i386 oneiric /mnt/hdd5/32/oneiric http://archive.ubuntu.com/ubuntu/ chroot /wheezy apt-get install linux-image-3.0.0-1-486 edit: initramfs.conf BOOT=nfs mkinitramfs -o initrd.img.netboot 3.0.0-1-486 edit: /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo [...]

fail2ban грешка при сатратиране в iptables

When using fail2ban with iptables, it is possible that errors occur when fail2ban tries to load the iptable chains… Error messages are similar to the following: iptables -I INPUT -p tcp -m multiport –dports smtp -j fail2ban-rulename returned 400 The error codes can have different values like 200, 100, 400. It seems to be a [...]

, ,

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!