This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tech:app:start [2018/04/10 01:00] rk4n3 |
tech:app:start [2021/10/17 13:46] (current) rk4n3 |
||
---|---|---|---|
Line 5: | Line 5: | ||
Create key for specific purpose or other user:<code>ssh-keygen -f keybasename -C "user@host"</code> | Create key for specific purpose or other user:<code>ssh-keygen -f keybasename -C "user@host"</code> | ||
+ | ==== GnuPG ==== | ||
+ | Encrypt:<code>gpg --encrypt -r keyid --armor < inputfile -o outputfile</code> | ||
+ | Decrypt:<code>gpg --decrypt filename</code> | ||
+ | List keys:<code>gpg --list-options "show-keyring" [--list-keys|--list-secret-keys]</code> | ||
+ | Create key:<code>gpg --full-generate-key</code> | ||
+ | Import keys:<code>gpg --import keyname_pub.asc | ||
+ | gpg --allow-secret-key-import --import keyname_sec.asc</code> | ||
+ | Export keys:<code>gpg --output keyname_pub.asc --armor --export keyid | ||
+ | gpg --output keyname_sec.asc --armor --export-secret-key keyid</code> | ||
+ | Delete keys:<code>gpg --delete-secret-keys XXKEYIDXX | ||
+ | gpg --delete-keys XXKEYIDXX</code> | ||
+ | Flush password cache:<code>echo RELOADAGENT | gpg-connect-agent</code> | ||
+ | |||
+ | ==== Vim ==== | ||
+ | Switch to hex mode: '':%!xxd'' \\ | ||
+ | Switch back from hex mode: '':%!xxd -r'' \\ | ||
+ | |||
+ | ------ | ||
====== Technical Application Topics ====== | ====== Technical Application Topics ====== | ||
Line 55: | Line 73: | ||
==== Home page for libfprint ==== | ==== Home page for libfprint ==== | ||
[[https://www.freedesktop.org/wiki/Software/fprint]] | [[https://www.freedesktop.org/wiki/Software/fprint]] | ||
+ | |||
+ | ===== OpenSSL ===== | ||
+ | Here's a quick/easy self-signed SSL cert creation command: | ||
+ | <WRAP prewrap><code>openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes</code></WRAP> | ||
+ | Alternately, for a separate key & cert file: | ||
+ | <WRAP prewrap><code>openssl req -newkey rsa:2048 -nodes -keyout yourapp.key -x509 -days 365 -out yourapp.pem</code></WRAP> | ||
+ | |||
+ | ===== apache ===== | ||
+ | ==== SSL ==== | ||
+ | * yum install mod_ssl | ||
+ | * On CentOS, edit ''/etc/httpd/conf.d/ssl.conf'' and: | ||
+ | * Comment out the SSL key file entry | ||
+ | * Ensure correct name of SSL cert file | ||
+ | * Remove password from PEM cert:<code>openssl rsa -in mycert.pem -out newcert.pem | ||
+ | openssl x509 -in mycert.pem >> newcert.pem</code> | ||
+ | * On CentOS, put password-less PEM/OpenSSL cert file at ''/etc/pki/ssl/certs/localhost.pem'' | ||
+ | * If you need to re-create the key from the PEM:<code>openssl rsa -in mycert.pem -out mycert.key</code> | ||
+ | * Restart apache | ||
===== lighttpd ===== | ===== lighttpd ===== | ||
Line 167: | Line 203: | ||
... and then you would want to include that config file from the primary config file (''~lighttpd/etc/lighttpd.conf'') \\ ''include "lighttpd-hostname.conf"'' | ... and then you would want to include that config file from the primary config file (''~lighttpd/etc/lighttpd.conf'') \\ ''include "lighttpd-hostname.conf"'' | ||
- | ==== SSL ==== | + | ==== WordPress ==== |
- | Here's a quick/easy self-signed SSL cert creation command: | + | This re-write config should be populated into the vhost config:<WRAP prewrap><code> |
- | <code>openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes</code> | + | url.rewrite-once = ( |
+ | "^/(wp-.+).*/?" => "$0", | ||
+ | "^/(sitemap.xml)" => "$0", | ||
+ | "^/(xmlrpc.php)" => "$0", | ||
+ | "^/keyword/([A-Za-z_0-9\-]+)/?$" => "/index.php?keyword=$1", | ||
+ | "^/.*?(\?.*)?$" => "/index.php$1" | ||
+ | )</code></WRAP> | ||
------ | ------ | ||
===== Snippets ===== | ===== Snippets ===== | ||
+ | |||
+ | ==== rsyslog: custom log file ==== | ||
+ | Add something like this into a ''/etc/rsyslog.d/myprogram.conf'' file: | ||
+ | <code># Separate myprogram logging into its own file | ||
+ | if $programname == 'myprogram' then /var/log/myprogram.log | ||
+ | & stop</code> | ||
+ | ... then, something like ''logger -t myprogram "this is a log message"'' will get routed to the custom log file. \\ | ||
+ | PHP code to do the same:<code> | ||
+ | openlog( "myprogram", 0, LOG_LOCAL6); | ||
+ | syslog( LOG_NOTICE, "this is a log message"); | ||
+ | </code> | ||
+ | Also, don't forget to add the custom log to ''logrotate'' by populating a file like ''/etc/logrotate.d/myprogram'' with:<code> | ||
+ | /var/log/myprogram.log { | ||
+ | missingok | ||
+ | weekly | ||
+ | size 2G | ||
+ | copytruncate | ||
+ | rotate 12 | ||
+ | notifempty | ||
+ | }</code> | ||
==== Ardour, Hydrogen & Jack under Windows ==== | ==== Ardour, Hydrogen & Jack under Windows ==== | ||
Line 219: | Line 281: | ||
==== Sendmail ==== | ==== Sendmail ==== | ||
+ | A useful reference: [[https://www.ietf.org/rfc/rfc1912.txt|RFC 1912]] \\ | ||
+ | In particular, ''MX'' DNS records should not refer to ''CNAME'' records, only ''A'' records | ||
+ | |||
=== Forwarding EMail: === | === Forwarding EMail: === | ||
In order to forward mail using a ''.forward'' file, and when your home directory has to be group-writable, this ''sendmail'' option has to be specified in the configuration: | In order to forward mail using a ''.forward'' file, and when your home directory has to be group-writable, this ''sendmail'' option has to be specified in the configuration: | ||
Line 306: | Line 371: | ||
</code> | </code> | ||
+ | ==== Firefox ==== | ||
+ | === Minimal browser window === | ||
+ | First, add a profile by launching firefox like: ''firefox --new-instance -P profilename'' \\ | ||
+ | ... and add a profile to suit the app you want to run in the minimal window. \\ | ||
+ | Open firefox using the profile, and go to ''about:config'' in the URL bar. \\ | ||
+ | Change the value of ''toolkit.legacyUserProfileCustomizations.stylesheets'' to true. \\ | ||
+ | Then, populate file ''$HOME/.mozilla/firefox/<profileid>.<profilename>/chrome/userChrome.css'' with: \\ | ||
+ | <code> | ||
+ | /* | ||
+ | * Do not remove the @namespace line -- required to work | ||
+ | */ | ||
+ | @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */ | ||
+ | |||
+ | /* | ||
+ | * Hide tab bar, navigation bar and scrollbars | ||
+ | * !important may be added to force override, but not necessary | ||
+ | */ | ||
+ | #TabsToolbar {visibility: collapse; !important; } | ||
+ | #navigator-toolbox {visibility: collapse; !important; } | ||
+ | #content browser {margin-right: -14px; margin-bottom: -14px;} | ||
+ | </code> | ||
==== Vim ==== | ==== Vim ==== |