PDFtk server

Read More

 

Build PDFtk Server

You can compile PDFtk Server from its source code. PDFtk Server is known to compile and run on Debian, Ubuntu Linux, FreeBSD, Slackware Linux, SuSE, Solaris and HP-UX.

  • Download and unpack: pdftk-2.02-src.zip (~2MB)
  • Review the pdftk license information in: license_gpl_pdftk/readme.txt.
  • Review the Makefile provided for your platform and confim that TOOLPATH and VERSUFF suit your installation of gcc/gcj/libgcj. If you run apropos gcc and it returns something like gcc-4.5, then set VERSUFF to -4.5. The TOOLPATH probably doesn’t need set.
  • Change into the pdftk sub-directory,
  • run make -f Makefile.Debian (substitute your platform’s Makefile filename)

We have built pdftk using gcc/gcj/libgcj versions 3.4.5, 4.4.1, 4.5.0 and 4.6.3. Pdftk 1.4x fails to build on gcc 3.3.5 due to missing libgcj features. If you are using gcc 3.3 or older, try building pdftk 1.12 instead.

https://www.pdflabs.com/
Local download: pdftk-2.02-src.zip

Useful terminal commands in Ubuntu

Read More
INSTALL COMMAND-LINE INTERFACE (CLI) SOFTWARESome of the commands listed below are not available in Ubuntu or Debian by default.

To install the remaining CLI software, download the installation script install-additional-cli-software.sh, open your terminal, and execute it: bash install-cli-software.sh.

1. ESSENTIAL COMMANDS

  • Navigation: pwd, ls, cd folder (folders are case sensitive!), cd ...
  • File manipulation: cat, cp, ln, mkdir, mv, rm, rmdir, touch.
  • Help: man terminal_command .
  • Permissions: chgrp, chmod, chown, su, sudo.
  • Search: find.
  • Text editors: ed, nano, vi, vim.
  • Text file visualization: head, less, more, tail.
  • Install a package: sudo apt-get install package.
  • Uninstall a package: sudo apt-get purge package.
  • Remove packages that are no longer needed: sudo apt-get autoremove.

2. BASH SHORTCUTS

  • Autocomplete files, folders, commands, packages, etc.: Tab.
  • List all available files, folders, commands, packages, etc.: Tab + Tab.
  • Go to previous command: , or Ctrl + P.
  • Go to next command: , or Ctrl + N.
  • Search through previously used commands: Ctrl + R.
  • Interrupt whatever you are running: Ctrl + C.

2. BASIC COMMANDS

  • Compare files line by line: colordiff, diff, vimdiff, wdiff.
  • List files in databases that match a pattern: locate, sudo updatedb.
  • Network interface: ifconfig.
  • Report disk space usage: df -H, du -hs folder.
  • OpenSSH SSH client with X11 forwarding: ssh user@server -X.
  • Print lines matching a pattern from a text file: grep.
  • Print newline, word, and byte counts for each file: wc.
  • Secure copy (remote file copy program): scp.
  • Show current processes: htop, ps, top.

3. SCREEN COMMANDS

  • Create a screen session: screen.
  • Detach from the current screen session: Ctrl + A then D.
  • List the screen session identification strings: screen -ls.
  • Reattach to a screen session: screen -r session_id_string.
  • Terminate the current screen session: exit, or Ctrl + A then :quit.
  • Scroll up/down during session: Ctrl + A then Esc then //PgUp/PgDn.

4. OTHER COMMANDS

  • Extract an ISO file: 7z x filename.iso.
  • Report faked system time to programs: faketime.
  • Retrieves files from the web: wget.
  • Print shared library dependencies: ldd executable_filename.
  • Make symbolic links: ln -s input_filename output_link_name.
  • List block devices: lsblk.
  • Format USB stick as VFAT: sudo mkfs.vfat -I /dev/sdx -n NAME && sync.
  • Restore disk from image: sudo dd bs=1M if=im.iso of=/dev/sdx && sync.

5. FFMPEG COMMANDS

  • Convert image to 5 sec. video: ffmpeg -loop 1 -i 01.png -t 5 out.mp4.
  • 15 images to 30 Hz 5 sec. video: ffmpeg -r 3 -i %03d.png -r 30 out.mp4.
  • Resize video to 720p: ffmpeg -i input.webm -s 1280x720 output.webm.
  • Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video: ffmpeg -i in.mp4 -vf "fade=in:0:25, fade=out:975:25" out.mp4.
  • Concatenate videos: ffmpeg -f concat -i mylist.txt -c copy out.mp4.

6. SVN COMMANDS

  • Create new repository: svnadmin create repository_name.
  • Checkout: svn co svn+ssh://user@server/path/to/repository.
  • Update working copy: svn update.
  • Get status of current copy: svn status.
  • Add all items recursively: svn add *.
  • Add an item (if folder, adds recursively): svn add item_name.
  • Delete an item (if folder, deletes recursively): svn delete item_name.
  • Commit with log message: svn commit -m 'message'.

7. FIND EXAMPLES

  • Run files recursively in current dir.: find . -type f -exec file '{}' \;.
  • Delete all .svn folders: find . -iname .svn -prune -exec rm -r '{}' \;.
  • Copy all png files to png: find ./ -name *.png -exec cp '{}' ./png \;.

8. PDFTK EXAMPLES

  • Join all PDF files into a new PDF file: pdftk *.pdf cat output out.pdf.
  • Join 3 PDF files: pdftk in1.pdf in2.pdf in3.pdf cat output out.pdf.
  • Extract pages from a PDF: pdftk in.pdf cat 1 25-35 end output out.pdf.

http://milq.github.io/useful-terminal-commands-ubuntu-debian

Manuel Ignacio López Quintero

Byobu

Read More

It allows for the execution of multiple shells in one terminal. Byobu now includes an enhanced profiles, convenient keybindings, configuration utilities, and toggle-able system status notifications.

Invoke it simply with:
byobu

Now bring up the configuration menu. By default this is done by pressing the F9 key. This will allow you to:

  • View the Help menu

  • Change Byobu’s background color

  • Change Byobu’s foreground color

  • Toggle status notifications

  • Change the key binding set

  • Change the escape sequence

  • Create new windows

  • Manage the default windows

  • Byobu currently does not launch at login (toggle on)

The key bindings determine such things as the escape sequence, new window, change window, etc. There are two key binding sets to choose from f-keys and screen-escape-keys. If you wish to use the original key bindings choose the none set.

byobu provides a menu which displays the Ubuntu release, processor information, memory information, and the time and date. The effect is similar to a desktop menu.

Using the “Byobu currently does not launch at login (toggle on)” option will cause byobu to be executed any time a terminal is opened. Changes made to byobu are on a per user basis, and will not affect other users on the system.

One difference when using byobu is the scrollback mode. Press the F7 key to enter scrollback mode. Scrollback mode allows you to navigate past output using vi like commands. Here is a quick list of movement commands:

  • h – Move the cursor left by one character

  • j – Move the cursor down by one line

  • k – Move the cursor up by one line

  • l – Move the cursor right by one character

  • 0 – Move to the beginning of the current line

  • $ – Move to the end of the current line

  • G – Moves to the specified line (defaults to the end of the buffer)

  • / – Search forward

  • ? – Search backward

  • n – Moves to the next match, either forward or backward

    https://help.ubuntu.com/lts/serverguide/byobu.html

    http://byobu.co/

Scripts in /etc/cron.daily (or the other Cron directories)

Read More

Remember that you can not place scripts with a “.” in the name. The name must consist of all upper,lower,numbers,hyphens, or underscores. The reason is run-parts will not pickup the files that do not follow this rule.
To check the scripts running on this directory:
run-parts --test /etc/cron.daily

The user crontabs, as given by crontab -e or crontab -l, are NOT system crontabs.

Display posts plugin options

Read More

Display Posts Shortcode

Contributors: billerickson
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MQKRBRFVRUV8C
Tags: shortcode, pages, posts, page, query, display, list
Requires at least: 3.0
Tested up to: 4.6.0
Stable tag: 2.7.0

Display a listing of posts using the [display-posts] shortcode
Description

The Display Posts Shortcode was written to allow users to easily display listings of posts without knowing PHP or editing template files.

Add the shortcode in a post or page, and use the arguments to query based on tag, category, post type, and many other possibilities. You can also customize the output with parameters like: include_date, include_excerpt, and image_size.

Available Parameters
Customization with Filters
Extension Plugins
Full Change Log

Installation

Upload display-posts-shortcode to the /wp-content/plugins/ directory.
Activate the plugin through the Plugins menu in WordPress.
Add the shortcode to a post or page.

Parameters

author
Specify the post author
Default: empty
Example: [display-posts author=”bill”]

category
Specify the category slug, or comma separated list of category slugs
Default: empty
Example: [display-posts category=”fishing,hiking”]

category_display
Specify ‘true’ to display the categories the current post is in. Specify a taxonomy slug (e.g., ‘post_tag’) to list a different taxonomy
Default: empty
Example: [display-posts category_display=”true”]

category_label
If using category_display, specify the label that appears before the list of categories.
Default: “Posted in: ”
Example: [display-posts category_display=”true” category_label=”Categorized as: “]

content_class
Specify the class name used for the post content
Default: content
Example: [display-posts include_content=”true” content_class=”dps-listing-content”]

date_format
Specify the date format used when include_date is true. See Formatting Date and Time on the Codex for more information.
Default: ‘(n/j/Y)’
Example: [display-posts include_date=”true” date_format=”F j, Y”]

date
Specify a date to query for posts published that date. More info on Date Queries
Default: empty
Example: [display-posts date=”2014-09-07″]

date_column
Specify which date column to use for all date queries. More info on Date Queries
Default: post_date
Example: [display-posts date=”Yesterday” date_column=”post_modified_date”]

date_compare
Specify the comparison operator used for all date queries. More info on Date Queries
Default: =
Example: [display-posts date=”-1 year” date_compare=”>”]

date_query_before
Specify the before argument for a date query. More info on Date Queries
Default: empty
Example: [display-posts date_query_before=”2015-12-31″ date_query_after=”2015-01-01″]

date_query_after
Specify the after argument for a date query. More info on Date Queries
Default: empty
Example: [display-posts date_query_before=”2015-12-31″ date_query_after=”2015-01-01″]

date_query_column
Specify the date column used for this query. More info on Date Queries
Default: post_date
Example: [display-posts date=”Yesterday” date_query_column=”post_modified_date”]

date_query_compare
Specify the comparison operator used for this query. More info on Date Queries
Default: =
Example: [display-posts date=”-1 year” date_query_compare=”>”]

excerpt_length
Specify the number of words used in an excerpt. More information
Default: empty (set by your theme)
Example: [display-posts include_excerpt=”true” excerpt_length=”20″]

excerpt_more
Specify the more text that appears after the excerpt.
Default: empty (set by your theme)
Example: [display-posts include_excerpt=”true” excerpt_more=”…”]

excerpt_more_link
Specify whether or not to link the excerpt_more text to the post
Default: false
Example: [display-posts include_excerpt=”true” excerpt_more=”Continue Reading” excerpt_more_link=”true”]

exclude_current
Specify whether or not to exclude the current post from the query
Default: false
Example: [display-posts exclude_current=”true” taxonomy=”category” tax_term=”current”]

id
Specify a specific post ID (or multiple post IDs) to display.
Default: empty
Example: [display-posts id=”9, 10″]

ignore_sticky_posts
Specify whether or not to ignore sticky posts
Default: false
Example: [displa-posts ignore_sticky_posts=”true”]

image_size
Specify an image size for displaying the featured image, if the post has one. The image_size can be set to thumbnail, medium, large (all controlled from Settings > Reading), or a custom image size. See Image Alignment
Default: empty
Example: [display-posts image_size=”thumbnail”]

include_author
Specify whether or not to include the post’s author name.
Default: false
Example: [display-posts include_author=”true”]

include_content
Specify whether or not to include the full post content. Note that [display-posts] will be stripped out of the content to prevent infinite loops
Default: false
Example: [display-posts include_content=”true”]

include_date
Include the post’s date after the post title. The default format is (7/30/12), but this can be customized using the ‘date_format’ parameter.
Default: empty
Example: [display-posts include_date=”true”]

include_excerpt
Include the post’s excerpt after the title (and date if provided).
Default: empty
Example: [display-posts include_excerpt=”true”]

include_title
Include the post’s title
Default: true
Example: [display-posts include_title=”false” image_size=”thumbnail”]

meta_key
Specify a meta key, for meta queries or ordering
Default: empty
Example: [display-posts meta_key=”price” orderby=”meta_value_num” order=”ASC”]

meta_value
Specify a meta value, for meta queries
Default: empty
Example: [display-posts meta_key=”color” meta_value=”blue”]

no_posts_message
Specify a message to display if no posts are found
Default: empty
Example: [display-posts category=”on-sale” no_posts_message=”Sorry, no items are currently on sale”]

offset
The number of posts to pass over
Default: 0
Example: [display-posts offset=”3″]

order
Specify whether posts are ordered in descending order (DESC) or ascending order (ASC).
Default: DESC
Example: [display-posts order=”ASC”]

orderby
Specify what the posts are ordered by. See the available parameters here.
Default: date
Example: [display-posts orderby=”title”]

post_parent
Display the pages that are a child of a certain page. You can either specify an ID or ‘current’, which displays the children of the current page.
Default: empty
Example: [display-posts post_type=”page” post_parent=”8″]

post_status
Show posts associated with a certain post status
Default: publish
Example: [display-posts post_status=”publish, future”]

post_type
Specify which post type to use. You can use a default one (post or page), or a custom post type you’ve created.
Default: post
Example: [display-posts post_type=”event”]

posts_per_page
How many posts to display.
Default: 10
Example: [display-posts posts_per_page=”5″]

tag
Display posts from a specific tag, or tags. You must use the tag slug(ex: example-tag), not the tag’s name (ex: Example Tag).
Default: empty
Example: [display-posts tag=”tag1, tag2″]

taxonomy, tax_term, and tax_operator
Use these parameters to do advanced taxonomy queries. Use ‘taxonomy’ for the taxonomy you’d like to query, ‘tax_term’ for the term slug (or terms) you’d like to include, and ‘operator’ to change how the query uses those terms (most likely this field will not be needed). See Multiple Taxonomy Queries
Default: ‘taxonomy’ = empty , ‘tax_term’ = empty , ‘tax_operator’ = ‘IN’
Example: [display-posts taxonomy=”color” tax_term=”blue, green”]

time
Specify the time, to be used in a date query. More info on Date Queries
Default: empty
Example: [display-posts date=”Yesterday” time=”9:00am”]

title
Give the list of posts a title heading
Default: empty
Example: [display-posts title=”Recent Posts”]

wrapper
What type of HTML should be used to display the listings. It can be an unordered list (ul), ordered list (ol), or divs (div) which you can then style yourself.
Default: ul
Example: [display-posts wrapper=”ol”]

wrapper_class
Class applied to the wrapper tag for custom css formatting for this instance.
Default: display-posts-listing
Example: [display-posts wrapper=”div” wrapper_class=”my-grid-layout”]

wrapper_id
Specify an unique ID to be used on the wrapper of this listing
Default: empty
Example: [display-posts category=”cars” wrapper_id=”cars-listing”]