How to set a password on pdf in Ubuntu

This one is super simple. sudo apt-get install pdftk pdftk input-file.pdf output output-file.pdf userpw mysupersecretpassword



Move files while preserving timestamps

A quick way to move files in linux while keeping their timestamps. In short mv doesn't support this. The work around is to copy instead. cp -p -r -l source/date target/ rm -rf source/data



How to call a python function by using a variable python

I needed to, in a programmatic way, determine the function name and then call the function. Here's an example use case. I have a bunch of functions called, ["function1", "function2", "function3", "function4", etc] Then I have a function that takes a number as a param. Then should return the proper …



Mozilla Developer Edition

I recently discovered Mozilla Developer Edition. {.alignnone width="832" height="456"} So far I've love it's inline ability to edit css. It's an entirely natural way to tweak the css on the fly.



Convert pdf to png easily

I need to quickly convert odfs to image for both online processing and one off processing. Luckily imagemagick had me covered for both. First install imagemagick: sudo apt-get install imagemagick Then use the convert function to do the work: convert example.pdf example.png This will append ## to the file …



October CMS How to replace component templates from plugins

How can you replace component templates from plugins? IE I want to replace the posts default template in the blog plugin with my own markup. Post List from the blog plugin -- Edit -- Use the override of a template instead. https://octobercms.com/docs/cms/components#overriding-partials -- Old way -- Turns out …



October CMS set preview post length

October CMS is a brilliant new developer focused CMS. It reminds me of working on XenForo in it's ease of creating add-ons. A very nice system. After configuring the blog I needed to limit the post except size for post that didn't have an except. This meant shrinking the normal …



How to format hdfs in AWS Elastic Map Reduce

It's insanely simple. Connect to your master node within AWS Elastic Map Reduce. Then you'll want to connect to the hadoop cluster and reset the NameNode file handlers. hadoop namenode -format That's it. That's how you format the hdfs file system.



How to use load data from s3 in to elastic map reduce

How to load data from s3 in to Amazon Elastic Map Reduce is fairly easy. The trick is to use s3n or s3 at the data source. A = LOAD 's3n://AWSKEY:AWSTOKEN@your-s3-bucket/file-name\*' as (col1:chararray, col12:chararray, col3:chararray, \[...\]);



How to watch nbc extra live on linux

How to watch nbc extra live on linux is simple. It just requires adding a flash plugin. apt-get install adobe-flash This can also be installed via the software manager. Just search for "flash".