-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode-snippets.html
75 lines (70 loc) · 3.51 KB
/
code-snippets.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel='me' href='https://post.lurk.org/@artistsandhackers'>
<link rel='me' href='https://leetusman.com'>
<link rel="icon" href="./assets/img/favicon.ico">
<meta property='og:type' content='website' />
<meta property='og:image' content='https://leetusman.com/archiving-artist-spaces/assets/img/banner.jpg'>
<meta property='og:title' content="Archiving Artist-Run Sites">
<meta property='og:description' content="preserve the online activities of DIY and artist-run communities.">
<meta name='description' content="explorations of joyful and human-scale computing.">
<meta property='og:url' content='https://leetusman.com/archiving-artist-spaces'>
<title>code-snippets</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="assets/css/main.css" />
<header>
<a href='./'><p>🗃️ Archiving Artist-Run Spaces</p></a>
<nav>
<p>
<p><a href='.'>Home</a> <a href='./about.html'>About</a> <a href='./archives.html'>Archives</a> <a href='./resources.html'>Resources</a> <a href='./reading.html'>Reading</a> <a href='./devlog.html'>Log</a> </p>
</nav>
</header>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<main>
<h1 id="useful-code-snippets">Useful code snippets</h1>
<p>These snippets of code are meant to be run on the command line,
especially on a Linux-based machine. They will require extra packages to
run.</p>
<h2 id="reduce-size-of-a-pdf">Reduce size of a PDF</h2>
<p>Using Ghostscrpt</p>
<p>Requires ghostscript package.</p>
<pre><code>gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default \
-dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages \
-dCompressFonts=true -r150 -sOutputFile=output.pdf input.pdf</code></pre>
<p><a
href="https://askubuntu.com/questions/207447/how-to-reduce-the-size-of-a-pdf-file">from
AskUbuntu</a></p>
<h2 id="convert-pdf-to-individual-image-files-for-each-page">Convert pdf
to individual image files for each page</h2>
<p>Requires poppler-utils.</p>
<pre><code>pdftoppm -png input.pdf outputname</code></pre>
<p>By default images will be at 150dpi resolution but can be
altered.</p>
<p><a
href="https://www.howtogeek.com/devops/convert-pdf-to-images-from-the-linux-command-line/">from
HowToGeek</a></p>
</main>
<footer>
<hr/>
<p><a href='.'>Home</a> <a href='./about.html'>About</a> <a href='./archives.html'>Archives</a> <a href='./resources.html'>Resources</a> <a href='./reading.html'>Reading</a> <a href='./devlog.html'>Log</a> </p>
<p>Texts, images, and site code are shared with the <a href='https://wiki.p2pfoundation.net/Peer_Production_License' target=_blank rel='external noreferrer noopener' title='Peer Production License'>Peer Production License</a>.</p>
<p><a href="https://leetusman.com/archiving-artist-spaces"><img src="assets/img/banner.jpg" /></a></p>
</footer>
</body>
</html>