Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicolas Bohorquez nickmancol

View GitHub Profile
@nickmancol
nickmancol / global_emissions.csv
Last active Dec 6, 2021
InfluxDB Write of global CO2 emissions 1751-2014, Source: Tom Boden (Oak Ridge National Laboratory), Gregg Marland (Appalachian State University), and Bob Andres (Oak Ridge National Laboratory)
View global_emissions.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have columns, instead of 7. in line 1.
"Year","Total carbon emissions from fossil fuel consumption and cement production (million metric tons of C)","Carbon emissions from gas fuel consumption","Carbon emissions from liquid fuel consumption","Carbon emissions from solid fuel consumption","Carbon emissions from cement production","Carbon emissions from gas flaring","Per capita carbon emissions (metric tons of carbon; after 1949 only)"
1751,3,0,0,3,0,0
1752,3,0,0,3,0,0
1753,3,0,0,3,0,0
1754,3,0,0,3,0,0
1755,3,0,0,3,0,0
1756,3,0,0,3,0,0
1757,3,0,0,3,0,0
1758,3,0,0,3,0,0
1759,3,0,0,3,0,0
View sample-read-csv-webharvest.xml
<config>
<var-def name="fileContent"><file path="file.csv" action="read"></file></var-def>
<var-def name="destVar">
<script return="lines"><![CDATA[
lines = fileContent.toString().split(System.getProperty("line.separator"));
]]></script>
</var-def>
</config>
@nickmancol
nickmancol / script-rename.sh
Created Jan 20, 2017
Bash script to rename files listed in a master file
View script-rename.sh
#!/bin/sh
CURRENT=1
FILENAME=selectivo.xhtml.html
while [ true ]; do
if test -f $FILENAME
then
mv $FILENAME $CURRENT.html
CURRENT=`expr $CURRENT + 1`
fi
sleep 1
@nickmancol
nickmancol / server.xml
Created Jan 5, 2017
Tomcat 8 server.xml, configures context to replace ROOT application context
View server.xml
<?xml version='1.0' encoding='utf-8'?>
<Server port="9005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
@nickmancol
nickmancol / setclasspath.sh
Created Jan 5, 2017
Tomcat 8 setclasspath, configures grails environment and some performance options
View setclasspath.sh
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0