Difference between revisions of "Programming language cook book"

From Review or Discard at Will
Jump to: navigation, search
(Add fc.22 firewall-cmd)
(Added 7-zip)
Line 1: Line 1:
 
=Mostly just for me to remember stuff=
 
=Mostly just for me to remember stuff=
 +
I might use a command once, then not again for years. Hopefully I can jog my memory quickly here.
  
 
==Python==
 
==Python==
Line 27: Line 28:
 
# be sure to reload
 
# be sure to reload
 
  firewall-cmd --reload
 
  firewall-cmd --reload
 +
</source>
 +
 +
==7-zip==
 +
I wanted to create a .zip file for my FDDSE project from the command line. Perhaps in a batch file.
 +
<source lang="text">
 +
7z a -tzip FDDSE.zip FDDSE
 
</source>
 
</source>

Revision as of 12:13, 23 September 2015

Mostly just for me to remember stuff

I might use a command once, then not again for years. Hopefully I can jog my memory quickly here.

Python

I wanted a json utc datetime for a MQTT payload. Found the arrow module that is much like moment.js for javascript.

import arrow
print (arrow.get(arrow.utcnow()).for_json()

results in: "2015-08-27T15:03:07.427351+00:00" I'd like to trim it further and replace the +00:00 with Z. ??? and less precision on the seconds.

Documentation for ISO 8601

Mediawiki

display unformated like code snippets

<source lang="text"> code snippet </source>

Fedora fc.22

I opened up node.js on port 3000 with this command.

firewall-cmd --permanent --add-port=3000/tcp
# be sure to reload
 firewall-cmd --reload

7-zip

I wanted to create a .zip file for my FDDSE project from the command line. Perhaps in a batch file.

7z a -tzip FDDSE.zip FDDSE