Thursday, February 18, 2016

Sql Commands to clear all Entries of invoiceplane

TRUNCATE ip_invoices;
TRUNCATE ip_invoice_amounts;
TRUNCATE ip_invoice_custom;
TRUNCATE ip_invoice_items;
TRUNCATE ip_invoice_item_amounts;
TRUNCATE ip_invoice_tax_rates;
TRUNCATE ip_payments;
TRUNCATE ip_payment_custom;
TRUNCATE ip_quotes;
TRUNCATE ip_quote_amounts;
TRUNCATE ip_quote_custom;
TRUNCATE ip_quote_items;
TRUNCATE ip_quote_item_amounts;
TRUNCATE ip_quote_tax_rates;

ALTER TABLE ip_invoices AUTO_INCREMENT = 1;
ALTER TABLE ip_invoice_amounts AUTO_INCREMENT = 1;
ALTER TABLE ip_invoice_custom AUTO_INCREMENT = 1;
ALTER TABLE ip_invoice_items AUTO_INCREMENT = 1;
ALTER TABLE ip_invoice_item_amounts AUTO_INCREMENT = 1;
ALTER TABLE ip_invoice_tax_rates AUTO_INCREMENT = 1;
ALTER TABLE ip_payments AUTO_INCREMENT = 1;
ALTER TABLE ip_payment_custom AUTO_INCREMENT = 1;
ALTER TABLE ip_quotes AUTO_INCREMENT = 1;
ALTER TABLE ip_quote_amounts AUTO_INCREMENT = 1;
ALTER TABLE ip_quote_custom AUTO_INCREMENT = 1;
ALTER TABLE ip_quote_items AUTO_INCREMENT = 1;
ALTER TABLE ip_quote_item_amounts AUTO_INCREMENT = 1;
ALTER TABLE ip_quote_tax_rates AUTO_INCREMENT = 1;

UPDATE ip_invoice_groups SET invoice_group_next_id = 1 WHERE invoice_group_id = 3;
UPDATE ip_invoice_groups SET invoice_group_next_id = 1 WHERE invoice_group_id = 4;

Installing Invoiceplane on your LAMP server

Step to install LAMP

Type the following command in the terminal

1. sudo apt-get install tasksel
2. sudo tasksel install lamp-server
Note: Popup will appear during installation and ask you set the MYSQL root password.

Installing InvoicePlane

1. cd /var/www/html/
2. mkdir invoiceplane
3. wget https://invoiceplane.com/download/v1.4.6
4. unzip v1.4.3*
Now set the folder permission
sudo chow –R myuser invoiceplane/
Now configure MySQL
Type command
sudo mysql_secure_installation
Then configure:
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Next we will need to log in to the MySQL console and create a database for the InvoicePlane. Run the following command:

mysql -u root -p

CREATE DATABASE invoiceplane;
Now we will create newuser with the password danat123$
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'danat123$';
Grant Privileges to the user myuser
GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'localhost';
FLUSH PRIVILEGES;
\q

Configuring Apache web server for InvoicePlane
Edit the apache2.config
Cd /ete/apache2
Sudo nano apache2.conf
Change below lines from
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride OFF
Require all granted
<Directory>

To

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
<Directory>

Now goto below location and edit htaccess file

sudo cd /var/www/html
sudo nano

Change

RewriteEngine on
RewriteBase /subdirectory
RewriteRule  index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

To

RewriteEngine on
RewriteBase /
RewriteRule  index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

Note the only changes in second line RewriteBase /subdirectory to RewriteBase /

Save and restart apache service

Now goto http://localhost/index.php/setup/language and follow the instruction





Monday, February 24, 2014

Poweroff and Restart in Linux without Sudo

To poweroff and restart in linux without sudo
        sudo chown root:user_name /sbin/poweroff && sudo chmod 4770 /sbin/poweroff

External USB WD Elements HDD Unmountable, Error


I'm using a 1 TB external HDD from Western Digital, Element series. Formatted as NTFS.
I was able to unable to mount the drive
And I got this error message and some instructions for windows system:

Error Code:
Error mounting: mount exited with exit code 13:
$MFTMirr does not match $MFT (record 0).
Failed to mount '/dev/sdb1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.


I can't even mount to check it.

Solution
------------------------------------------------------------------------------------------------
 Solved it using ntfsprogs package
    sudo apt-get install ntfsprogs
    sudo ntfsfix /dev/sdb1


*Replace the device path with your own error report's device path.

Friday, September 13, 2013

Installing Cannon lbp 2900b printer on Linux Mint 17.1



1. Power On Printer after login check              
    ls -l /dev/usb/ should return lp0

2. Install packages downloaded from canon site
    cndrvcups-common_2.60-1_amd64.deb
    cndrvcups-capt_2.60-1_amd64

3. Install following
        sudo apt-get install portreserve, gsfonts, gsfonts-other, gsfonts-x11
        sudo apt-get install libc6:i386 libpopt0:i386

4. Type on Terminal
        sudo service cups restart
        sudo /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp://localhost:59687 -E
        sudo /usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0
        sudo service ccpd restart


5. Ensure that there are two processes by checking
        sudo service ccpd status captstatusui -P LBP2900

6. If you are seeing the message Ready to print, you are done!
    Else you may have to restart the system, and repeat all the steps. 
    Switch off the printer and switch on. Another printer LBP2900-2 may install disable it in printers app.

7. To ensure that printer is available after reboot edit /etc/rc.local and add
    service cups restart service ccpd restart

 

Linuxmint 64bit vs cannon lbp2900b

i have no idea about other printers but cannon lbp2900b and my linuxmint 64 bit never jelled together after trying out most of the solutions...