Daily Archives: February 18, 2017

Bash Script to Execute Mysql Command

Published by:

Here is my bash script to execute msyql command

!/bin/bash
tglblk=$(date –date=”8 days ago” +%Y-%m-%d)
tglhapus=”$tglblk 23:00:00″
SQL=”DELETE FROM Events WHERE EndTime<=’$tglhapus’;”
MYSQL_USER=”root”
MYSQL_PASS=””
MYSQL_DB=”mydb”
echo $SQL | mysql –user=$MYSQL_USER –password=$MYSQL_PASS $MYSQL_DB

Then I put it into crontab to run at specific time.

Canon LBP3050 in slackware 13.37

Published by:

After I upgrade my slackware from 13.1 to 13.37 the canon LBP3050 printer works just fine. Nothing change in the configuration. The already wrote the installation method here. Until today, I made a mistake by changing the usb cable into another usb port and I delete the printer in cups browser, the printer won’t connect anymore.

I don’t know what happen. I repeated the action from the beginning. I suspect this is happen because I installed cnij 3.30 the common and the 2700 printer for canon ip2770. I removed them and expect the LBP3050 will work again but nothing.

I delete the LBP3050 from cups browser (localhost:631) and re put it again by typing in the console
#lpadmin -P LBP3050 -m CNCUPSLBP3050CAPTK.ppd -c ccp:/var/ccp/fifo0 -E
The printer appears in the cups browser but when I test it to print, still nothing happen.
I check the capstatusui from terminal in user privileged,
#captstatusui -p LBP3050
The box show up and show the printer error, check the /etc/ccpd.conf for the connection.
I check /etc/ccpd.conf and find out that the setting still the same

DevicePath /dev/usb/lp0

Then I check dmesg in root privileged. And I found out something else…
root#dmesg | grep lp0
It show the printer assigned to usblp0 not usb/lp0
I find the usblp0
root#ls -lh /dev/ | grep usblp0
And yes there is usblp0

Now I try to change the conection to usblp0, I remove the printer from cups browser and repeat the next action in the terminal.
root#lpadmin -P LBP3050 -m CNCUPSLBP3050CAPTK.ppd -v ccp:/var/ccp/fifo0 -E
root#ccpadmin -p LBP3050 -o /dev/usblp0

I check the captstatusui -p LBP3050 it show the printer is on.
I try to print and it works again. fuih….