{"id":297,"date":"2009-04-25T16:18:22","date_gmt":"2009-04-25T23:18:22","guid":{"rendered":"http:\/\/www.partofthething.com\/thoughts\/?p=297"},"modified":"2009-04-25T16:18:22","modified_gmt":"2009-04-25T23:18:22","slug":"commands-to-do-stuff-in-linux","status":"publish","type":"post","link":"https:\/\/partofthething.com\/thoughts\/commands-to-do-stuff-in-linux\/","title":{"rendered":"commands to do stuff in linux"},"content":{"rendered":"<p>Here are some nice commands.<\/p>\n<p>Combine lots of pdf files:<\/p>\n<p><code>gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH 1.pdf 2.pdf 3.pdf<\/code><\/p>\n<p>Convert eps files to eps files with perfectly fitting bounding boxes:<\/p>\n<p><code>epstool --copy -b file1.eps newfile.eps<\/code><\/p>\n<p>Pull pages out of a pdf (<a href=\"http:\/\/www.accesspdf.com\/pdftk\/\">more<\/a>):<br \/>\n<code><br \/>\npdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf<\/code><\/p>\n<p>Make a quicktime movie with ffmpeg:<br \/>\n<code><br \/>\nffmpeg -f mp4 -vcodec mpeg4 -i case3-flyby.avi case3-flyby.mov<\/code><\/p>\n<p>Encode lots of jpgs to avi:<br \/>\n<code>mencoder mf:\/\/hexes???.jpg -mf fps=10:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi<\/code><\/p>\n<p>Convert pngs to jpg:<br \/>\n<code>mogrify -format jpg -quality 90 hexes???.png<\/code><\/p>\n<p>Shrink a bunch of jpgs:<br \/>\n<code>convert -resize 20% IMG_2704.JPG sm_IMG_2704.JPG<br \/>\n<\/code><\/p>\n<p>Pull audio out of a video file:<br \/>\n<code>ffmpeg -i was014.dv -ab 128 -ar 44100 was1.mp3<\/code><\/p>\n<p>Play audio faster or slower without changing the pitch<br \/>\n<code>mplayer -af scaletempo was1-fixed-up.mp3 <\/code>. Use [ or ] to change speed.<br \/>\n(Note: you have to have a more modern version of mplayer to do this https:\/\/launchpad.net\/~rvm\/+archive\/mplayer)<\/p>\n<p>Run povray with 100 frames on the clock:<br \/>\n<code>povray -W1200 -H1000 +kff100 hexes.pov<\/code><\/p>\n<p><img decoding=\"async\" id=\"kosa-target-image\" style=\"position: absolute; visibility: hidden; z-index: 2147483647; left: 183px; top: 151px;\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAUCAYAAACJfM0wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDQvMDQvMDhrK9wWAAACLklEQVQ4jbXUP0wTcRQH8O\/9ekdjkT8CUqpee00bRyNNmSRSV0PcJJoQg2i6ODTExEUHg04OaNSppqtCjQ4ukDSKSuLUwcm4NNZcQYsIGtD+u\/f7MZSWXltqo\/Ul7\/JL7u7z3r3fLye53e5xj8ejoYWRSCSSstfr1YLBYHcr4XA4rMmMMciy3EoXjDHIjDEoivL\/4fefrP1P3nYEvqzLajOIo8fQz5\/cfH3cnVttCM8udQaODBxQFx44Ye9h4HxvdGWtgMlbSXV2SQoMHf0RNcGSJJlmvPLdos7fdyIWL+D5myx+ZwwUDAIRh2EU1wYRFItA6FwvIjdcGJr4qFYakiSBlTavlABwsJth7mUWmSyBOAfnAkQE4gKccxBx\/MoYmHmcxuH+NgAwGQ03j3NeRjjnoGqcC\/zcIgghAMBkNISJuKlbEy4EaKdoKerC5nNMxQdlgVx+t0siKhYQovwV1rbdtyoNxlhxxoqilBMA0uuES6Pt6NqP2hHsoDarhJuXD2F5NV\/uuJR1T4XLzvTJ25\/VyHUnzgzba0YkKq6pdB4T00m47EyvPhU1M54asy3ee5o55bvwQQWAr\/PHMBfbQGhGrykCANqARZ8asy3+ccYjg\/K3kcF9UQAYvrJ29dmrDUxHlnOxu72P+rpYrq5eFU39K649TCF0tnPB0WdtCt2z48rQHIp+8XTHu9ET7alm0aY6fnFHjda98a\/w3wZjDJLP5xv3+\/1aK+F4PJ7cBm32CUNiyI2GAAAAAElFTkSuQmCC\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are some nice commands. Combine lots of pdf files: gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH 1.pdf 2.pdf 3.pdf Convert eps files to eps files with perfectly fitting bounding boxes: epstool &#8211;copy -b file1.eps newfile.eps Pull pages out of a pdf (more): pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf Make a quicktime movie with &hellip; <a href=\"https:\/\/partofthething.com\/thoughts\/commands-to-do-stuff-in-linux\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">commands to do stuff in linux<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-297","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":0,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts\/297\/revisions"}],"wp:attachment":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}