PDFtk on CentOS7

Months ago, I tested it with positive results on either Mac OSX and/or Ubuntu 14.04 so now I’m gonna test it on the new CentOS7. If it doesn’t work, I’ll either wipe the VPS and install CentOS6 or Ubuntu 16.04. First, I have to remember how I used the templates I created to test it. Ugh.

Watching The Defenders on Netflix, btw. I wanna like Iron Fist so bad. Loved the comics. Iron Fist, that is, not the Defenders. Except for Defenders: Indefensible.

So, testing process is:

  1. Get form field info using dump_data_fields
  2. Export fdf from a filled-in form using generate_fdf
  3. Import that fdf data to fill in an empty version of that same form via fill_form

I have a PDF form that, filled out, looks like this:

AlbumForm

So, first, I need to get the names of the form fields.

pdftk AlbumFormEmpty.pdf dump_data_fields >AlbumForm.txt

That was successful. Yay. Result looks like this:

textOutputDump

Now, I’ll export the data from the filled-in form’s content — not normally a part of this process, but it’ll quickly get me the data and other shizzle I need for testing.

pdftk AlbumForm.pdf generate_fdf output AlbumData.fdf

Cool cool cool, that worked fine. It’s hideous, but I have it.

Later, I will/would write a PHP script to create such an fdf file out of data from an html form but for now, I’ll put that fdf back into a PDF form:

pdftk AlbumFormEmpty.pdf fill_form AlbumData.fdf output filled.pdf

Perfect. Awesome.

One of the places where I learned stuff:

https://www.sitepoint.com/filling-pdf-forms-pdftk-php/

Posted in CentOS, PDF, Server Admin | Tagged | Leave a comment

End of Old Host

I downloaded everything and backed it up then canceled my old host account (though they’re still the registrar for a domain I’ll never use again — famous last words I’ve uttered many times before losing a domain I later wanted back).

Then I realized, “Oh, crappy crap! I still haven’t set up the databases at my new host–nay, I’ve not even installed MySQL!” It certainly would have been useful to have the old PHPMyAdmin up on one monitor while creating the new ones on the new server. BUT, as with all things in this project and learning experience, it’ll be fun to do it from scratch and keep building up the muscle memory cells.

It’ll probably end up resulting in multiple improvements.

I also canceled my paid GitHub thingy. I was going through one of those paranoid periods that I think most, if not all, creatives go through — “Someone is going to steal my idea(s)!” but, now, my Stakeout repo is public again.

And, between cancelling these two, I’m $10-15/month richer!

Posted in Server Admin | Leave a comment

And, We’re Off

Everything is working. Everything is awesome. It helps to document everything. All of that documentation is growing over at what will be and is my new blog at jotasprout.github.io.

Before I move the current Stakeout files over to the new host, I have to install PDFtk (the whole purpose of getting my own VPS) on that server. So, I have to learn how to download something on a remote computer using the command line.

I can’t even express how awesome all of this is. All of the mistakes and learning is amazing — except when the mistakes and such are the fault of crappy tech “support” and “documentation.” Even when things take days and multiple tries, I dig it.

So, downloading something via command line …

Ultimate wget Download Guide with 15 Awesome Examples

Ah, wget — I’ve heard of that and, according to cauon on AskUbuntu.com, it’s my friend.

wget vs curl: How to Download Files Using wget and curl

Ah, yes, curl — I’ve seen that even more often.

wget seems easier (and supports recursive download but I’m not really interested in that):

wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-1.el6.x86_64.rpm

That would download the file to the current directory. This, to me, has always begged the question, “Does it matter in which directory I download?”

curl, on the other hand, supports oodles of protocols beyond the FTP and HTTP supported by wget.

Two other articles I’ll definitely be checking out later

Tecmint has so become one of my favorite sites. Everything is so well written and informative.

Back to the wget-ing … Once I’ve installed the rpm, can I delete the rpm? Is it like a pkg or tarball or other installation files I’ve used and deleted when I’m done? And … am I supposed to be deleting the pkg‘s? Recent reading makes me think I shouldn’t.

Downloading went fine. Step 2 of 3 is, “install libgcj, on which pdftk depends.”

Unfortunately, Ye Olde Terminal told me, “No package libgcj available. Error: Nothing to do.” Time to consult The Google.

I must say that I’ve been so happy the last week or two in that amidst all the search results for whatever problem I’m working on, there’s often one from 2017 and at least a couple from 2016.

Uh-oh. Lots of bad news from PDFtk dependency issues with CentOS-7 about PDFtk and libgcj. Most people moving to paid and/or inferior products. A bounty was offered for anyone who forks and updates it for CentOS7. That was four years ago.

I could just install CentOS6 — I wouldn’t mind at all starting from scratch and doing things smoothly and correctly now that I know how to do it all. That would rock. But … I’m also interested in solving this problem.

Something called copr might be a solution … gonna try it.

But, crap, do I now need to … wait … I didn’t install the rpm … I can just delete it. Okay, deep breath … removed it and tried this

wget https://copr.fedorainfracloud.org/coprs/robert/gcj/repo/epel-7/robert-gcj-epel-7.repo -P /etc/yum.repos.d

Crap. First need to fix permissions issues discovered yesterday — I’m not allowed to install or upload (or, apparently, download) anything into etc. Then I’ll try (saying/writing this so I have the text to copy & paste):

https://copr.fedorainfracloud.org/coprs/robert/pdftk/repo/epel-7/robert-pdftk-epel-7.repo -P /etc/yum.repos.d

yum install pdftk

I think that second url is supposed to have wget in front of it. We’ll see.

Okay, those commands from a March 2016 reply seemed to work (for myself and others) but I’ve also found PDFtk works on CentOS7 from August 2016 with a January 2017 update. I may check that out after testing what I’ve just installed. Oh, by the way, I didn’t change any permissions–I just logged in as root.

I should test it now.

Posted in myLearning, myProjects, Server Admin | Tagged | Leave a comment

GitHub Desktop and Friends

While I really do love GitHub Desktop (and really, really wish there was such an animal for Linux), I’m even more keen to learn how to use what looks like equivalent features I’ve seen in at least two of my editors.

Which reminds me I need to download the latest beta for Atom … apparently, it’s not as crashy.

Posted in GitHub | Leave a comment

I Feel the Need for FTP

Learning Vi. Comfortable with it. No longer fear it. But I’d much rather download files, edit them in just about anything other than the Terminal, and upload them.

FTP worked fine at first.

Then it let me download but not upload stuff (and FileZilla did some crazy-looking stuff while trying).

Now I can’t connect at all.

I’m sure it’s fine. I’m sure all the changes I’ve made have something (or everything) to do with it.

The top two links look the most promising.

https://www.tecmint.com/install-ftp-server-in-centos-7/

http://www.krizna.com/centos/setup-ftp-server-centos-7-vsftp/

http://www.tutorialspoint.com/articles/how-to-install-and-configuration-ftp-server-in-centos-7

This next one includes SSL/TLS stuff

https://www.digitalocean.com/community/tutorials/how-to-configure-vsftpd-to-use-ssl-tls-on-a-centos-vps

This is about FTP and (blech) WordPress.

http://prolinuxhub.com/configure-ftp-access-on-centos-7-and-grant-user-access-to-website/

Posted in CentOS, Server Admin | Leave a comment

Mastering My Domain Pt 4, I think

Using the two CentOS library books …

I’d already edited /etc/httpd/conf/httpd.conf by adding so now I added, below that

IncludeOptional sites-enabled/*.conf

Then, created /etc/httpd/sites-available/example.com.conf and typed into it

<VirtualHost *:80>
ServerName http://www.example.com
ServerAlias example.com
</VirtualHost>

And that seems familiar … some other tute told me to do that … and I either misunderstood it or did something else or both …

Ooh … I think I got it … stand by …

Posted in Server Admin | Leave a comment

Today’s Link Dump of Links I’m Using

I haven’t closed my browsers on this machine in days … some of these are repeats because they rock.

CentOS

https://www.vultr.com/docs/initial-setup-of-a-centos-7-server

https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-7

http://www.servermom.org/basic-centos-setup-before-building-a-working-server/414/

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-7

https://www.a2hosting.com/kb/getting-started-guide/accessing-your-account/enabling-two-factor-authentication-for-ssh

LAMP

http://www.bluepiccadilly.com/2013/03/recreating-my-perfect-web-development-environment-using-parallels-vm-and-centos

https://www.howtoforge.com/tutorial/centos-lamp-server-apache-mysql-php/

Apache

http://www.servermom.org/how-to-add-new-site-into-your-apache-based-centos-server/454/

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7

https://www.liquidweb.com/kb/how-to-install-apache-on-centos-7/

PHP

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7

https://www.vultr.com/docs/how-to-install-php-7-x-on-centos-7

Posted in Server Admin | Leave a comment