Skip to content

Instantly share code, notes, and snippets.

View coseos's full-sized avatar
🏢
Working

coseos coseos

🏢
Working
View GitHub Profile
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam dictum felis eu pede mollis pretium. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Aenean commodo ligula eget dolor. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Integer tincidunt.
Cras dapibus. Aenean vulputate eleifend tellus. Vivamus elementum semper nisi. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Donec vitae sapien ut libero venenatis faucibus. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero
@coseos
coseos / iot-501-pir
Last active December 13, 2021 13:52
{ 'timestamp': '14/10/2021 17:17:31', 'state': 'o' }
{ 'timestamp': '14/10/2021 17:17:47', 'state': 'o' }
{ 'timestamp': '14/10/2021 17:17:52', 'state': 'o' }
{ 'timestamp': '14/10/2021 17:18:02', 'state': 'o' }
{ 'timestamp': '14/10/2021 17:18:44', 'state': 'o' }
{ 'timestamp': '14/10/2021 17:18:48', 'state': 'o' }
{ 'timestamp': '14/10/2021 17:18:54', 'state': 'o' }
{ 'timestamp': '14/10/2021 17:22:13', 'state': 'o' }
2021:18:41##_#_#_#_#_#_##_#####_##_##_#_#_#_###_#_##_#_#_#_#_#_#_###_#_##_#_#_##_#_##_#_##_#_#_#_#_##_#_###_#_#_#_#_#_#_#_#_#_#####_##_##_##_###_#_#_#_##_#_#_##_#_##_
7:18:20:30
7:18:20:50
7:18:20:51#
7:18:20:51#
7:18:20:51#_
7:18:20:56#
7:18:20:57#_
7:18:20:59#_
7:18:21:4#_
#!/bin/bash
# Find all files and execute sha256sum on each, report to file checksum.sha256
#
find . -type f -exec sha256sum "{}" + | tee checksum.sha256
#!/bin/bash
# Make every deb line a comment, this should disable the microsoft repository referenced in vscode.list
sed -i -e 's/^deb/# deb/' /etc/apt/sources.list.d/vscode.list
# Remove the microsoft gpg key and replace with an empty file
rm /etc/apt/trusted.gpg.d/microsoft.gpg && touch /etc/apt/trusted.gpg.d/microsoft.gpg
# Mark files as immutable to avoid changes from updates
chattr +i /etc/apt/trusted.gpg.d/microsoft.gpg
@coseos
coseos / essential-properties-4-pom.xml
Created February 24, 2021 07:27
Essential properties for pom.xml with UTF-8 encoding and Java version 11
<!--
The essential properties for pom.xml include
- UTF-8 encoding for source files
- compiler version for source and target / Java 11
-->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
@coseos
coseos / X3_4_1968_USAscii.java
Created February 23, 2021 21:53
This Java class describes the non-printable control characters, by name, from the ANSI X3.4-1968 standard 7-bit charset, also known as US Ascii or ECMA-6.
package com.coseos.standards.ansi.x3;
/** This class describes the non-printable control characters, by name, from the ANSI X3.4-1968 standard 7-bit charset, also known as US Ascii or ECMA-6.
'I have also approved recommendations of the Secretary of Commerce regarding standards for recording the Standard Code for Information Interchange on magnetic tapes and paper tapes when they are used in computer operations. All computers and related equipment configurations brought into the Federal Government inventory on and after July 1, 1969, must have the capability to use the Standard Code for Information Interchange and the formats prescribed by the magnetic tape and paper tape standards when these media are used.'
Lyndon B. Johnson, March 11th 1968
*/
public class X3_4_1968_USAscii {
@coseos
coseos / install-oracle-jdbc-driver.sh
Created January 25, 2021 10:05
Simple script to install Oracle proprietary JDBC driver into local maven repository
#!/bin/bash
VERSION=19.8.0.0
JARFILE=ojdbc8-${VERSION}.jar
ARTIFACTID=coseos-oracle-jdbc8
GROUPID=com.oracle
MVN=$(which mvn)
function install {
@coseos
coseos / java-groovy-libraries.md
Last active May 23, 2020 18:04
Java/Groovy libraries

HowTo: Java and Groovy libraries

You can put .jar files in the ${JRE_HOME}/lib/ext folder to make a library available to the Java Runtime without any further CLASSPATH setting (like setting the environment variable or adding a -cp/-classpath parameter)

You can put .jar files in the ${HOME}/.groovy/lib folder to make a library available to Groovy in the same manner

This will only work on your local machine, so keep track of the libraries you use.

Another trick (for Groovy) is to add to the classpath at runtime with something like:

[Unit]
Description=derbyDB systemd service
After=syslog.target
[Service]
User=dbuser
WorkingDirectory=/home/dbuser/Database/DerbyDB
Type=simple