slackware64 14.1 – efi partitioning

cgdisk

8200 linux swap 10gb

8300 linux filesystem

ef00 efi system 10gb

elilo

fsck.vfat /dev/sdc (efi system)

Posted in Uncategorized | Tagged , | Leave a comment

slackware64 14.1 – samsung ml-1675 – cups

– download driver from samsung site , unified linux driver

– ./install.sh

– cd /usr/lib64/cups/filter/

ln -s rastertospl rastertosplc

– add printer from cups

thanks http://askubuntu.com/questions/390803/samsung-printer-ml-2545 and also http://www.linuxquestions.org

also check usblp module,

uncomment /lib/modprobe.d/cups-blacklist-usblp.conf

Posted in Uncategorized | Leave a comment

m4b to mp3

gist.github.com/2267094

———-
mkdir -p mp3s

SAVEIFS=$IFS
IFS=$(echo -en “\n\b”)

for i in `find . -type f -iname “*.m4[ab]” -print`; do
echo $i
NAME=`echo $i | sed -e ‘s/\.\///’ -e ‘s/\.m4b//g’ `
echo “doing ‘$NAME'”
faad –stdio $i | lame –preset standard – “mp3s/${NAME}.mp3”
done

IFS=$SAVEIFS

Posted in Uncategorized | Leave a comment

detach a process

I know two ways to do this (probably there are more):

Method 1:
– start the process from the konsole
– put it the background with Ctrl-Z and ‘bg 1’.
– tell the shell to detach the process with the command ‘disown -a’

Method 2:
– start the process with nohup (ie. write the command ‘nohup processname’ instead of ‘processname’. See ‘man nohup’ for an explanation.

Posted in Uncategorized | Leave a comment

how to mount lvm2 volumes

lvscan
#load device module
modprobe dm-mod
#change the volumes that exist to active
vgchange -ay
#mount the logical partition
mkdir -p /mnt/VolGroup00/LogVol00
mount /dev/VolGroup00/LogVol00 /mnt/VolGroup00/LogVol00

http://www.fedoraforum.org/forum/archive/index.php/t-64964.html

Posted in Uncategorized | Leave a comment

Servo motor test with Raspberry Pi

I have an EMAX ES08A servo motor which I could not make it work under Arduino Uno.
( I will test it again with external power).

I tried it with Raspberry Pi using Dr.Monks code and it worked.

http://www.doctormonk.com/2012/07/raspberry-pi-gpio-driving-servo.html

I have edited the code to test the motor.

Here is the code:

  1. import RPi.GPIO as GPIO
  2. import time
  3. pin = 17
  4. refresh_period = 0.01
  5. x = 0
  6. GPIO.setmode(GPIO.BCM)
  7. GPIO.setup(pin, GPIO.OUT)
  8. GPIO.output(pin, True)
  9. def servoWrite(timez):
  10.      print(”   time sleep is”, timez)
  11.      for i in range(1, 100):
  12.         GPIO.output(pin, False)
  13.         time.sleep(timez)
  14.         GPIO.output(pin, True)
  15.         time.sleep(refresh_period)
  16. while x < 3:
  17.     print(“starting”)
  18.     print(” x = “, x)
  19.     time.sleep(0.1)
  20.     for i in range(3,21):
  21.         a=(i/10000)
  22.         servoWrite(a)
  23.     x += 1
  24. print(“…….end…..”)

Motors specs are here

EMAX ES08A

4.8 - 6.0V

1.5 / 1.8 kg.cm

20.8 / 24.9 oz.in

0.12 / 0.10s / 60 degrees

I would be very happy if some could clarify what those terms mean.

My findings are :

Motor goes to 120 degrees clockwise when time.sleep is 0,0003.

Motor goes to 0 degrees when time.sleep is 0,0012.

Motor goes to 120 degrees counter clockwise when time.sleep equals 0,0021 .

These are not exact results.

Be careful with those values. I am not responsible for any harm happening to your gadgets.

Posted in Uncategorized | Leave a comment

mount-the-tmp-partition-with-noexec-and-nosuid-options

On Linux servers (especially web servers) it is recommended to create /tmp as separate partition and mount it with ‘noexec’ and ‘nosuid’ options. ‘noexec’ disables the executable file attribute within an entire filesystem, effectively preventing any files within that filesystem from being executed. ‘nosuid’ disables the SUID file-attribute within an entire filesystem. This prevents SUID attacks on the /tmp filesystem.

WARNING: Various services such as MySQL, Postgres, Plesk and Zend use /tmp as temporary storage. You must STOP these services before carrying out the procedure below. Failing to disable these services may cause major InnoDB database corruption.

1. Stop all services including Plesk, MySQL, Apache, Postgres, SpamAssassin and any other service utilizing the /tmp file system.

2. Copy all of the files in /tmp to a holding directory:

# cp -Rp /tmp /tmp-backup

3. If /tmp is a separate partition on the server, you only need to edit /etc/fstab and add ‘noexec’ and ‘nosuid’ options for /tmp (see step 5). Then remount the partition:

# mount -o remount /tmp

If the tmp file is not a separate partition (check using ‘# df -h’) then you will need to follow steps 4 – 10 below. Else, skip to step 11.

4. If /tmp directory resides on / partition, it is better to create new partition for /tmp, for example with size 1 GB:

# cd /var
# dd if=/dev/zero of=tmpMnt bs=1024 count=1048576
# mkfs.ext3 -j /var/tmpMnt

5. Add the string into /etc/fstab:

# cp /etc/fstab /etc/fstab~
# echo “/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0″ >> /etc/fstab

6. Mount new /tmp partition:

# mount -o loop,noexec,nosuid,rw /var/tmpMnt /tmp

7. /tmp should be chmod 0777:

# chmod 0777 /tmp

8. /tmp ownership should be root:root :

# chown root:root /tmp

9. Copy the old tmp files to the new tmp directory:

# cp -Rp /tmp-backup/* /tmp/
# rm -rf /tmp-backup

10. Remove and re-link old /var/tmp file:

# rm -rf /var/tmp/
# ln -s /tmp/ /var/tmp

11. Confirm that /tmp is mounted with noexec and nosuid:

# mount

Look for: “/dev/sdaX on /tmp type ext3 (rw,noexec,nosuid)”

12. Restart the services you previously shut down.

NOTE: This article was updated on April 5th 2011 to include a more optimized process.
http://www.md3v.com/mount-the-tmp-partition-with-noexec-and-nosuid-options

Posted in Uncategorized | Leave a comment