Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, February 6, 2014

Open mysql to accept connection other then localhost

My current project have a multi layer architecture in which mysql is running on a machine and all the other machines have to take connection on that.

By default Mysql allow connection to localhost(127.0.0.1) only. So i need to open for others as well. I need to change the configuration file of mysql

we can found that file at /etc/mysql/my.cnf (in ubuntu)

We need to change a property(bind address)

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address        = 127.0.0.1
  bind-address        = 0.0.0.0


Now restart the Mysql service

sudo service mysql restart

It may be possible that after doing all this you might not be able to login from different machine. For make that working you have to reset the root user password by

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

Thursday, January 23, 2014

Multiple operation on pdf in ubuntu using pdftk package

Pdftk package provides a lot of options  to work on Pdf, like concatenation, bursting, bursting  selected number of pages, Encryption , Decryption

 Examples:-
     
  • Decrypt a PDF
    pdftk secured.pdf input_pw foopass output unsecured.pdf
  • Encrypt a PDF using 128-bit strength (the default), withhold all per-       missions (the default)
    pdftk 1.pdf output 1.128.pdf owner_pw foopass
  • Same as above, except password 'baz' must also be used to open output       PDF
    pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz
  • Join in1.pdf and in2.pdf into a new PDF, out1.pdf
    pdftk in1.pdf in2.pdf cat output out1.pdf
    or (using handles):
    pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf
    or (using wildcards):
    pdftk *.pdf cat output combined.pdf
  • Remove 'page 13' from in1.pdf to create out1.pdf
    pdftk in.pdf cat 1-12 14-end output out1.pdf
    or:
    pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf
  • Join two files, one of which requires the password 'foopass'. The out-       put is not encrypted.
    pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf
  • Uncompress PDF page streams for editing the PDF in a text editor (e.g.,       vim, emacs)
  • Burst a single PDF document into pages and dump its data to doc_data.txt
    pdftk in.pdf burst
  • Burst a single PDF document into encrypted pages. Allow low-quality printing
    pdftk in.pdf burst owner_pw foopass allow DegradedPrinting
  • Rotate the first PDF page to 90 degrees clockwise
    pdftk in.pdf cat 1E 2-end output out.pdf
  • Rotate an entire PDF document to 180 degrees
    pdftk in.pdf cat 1-endS output out.pdf