Skip to content

Instantly share code, notes, and snippets.

@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active April 26, 2024 09:25
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@srayhunter
srayhunter / listlayer.xml
Created August 29, 2015 05:32
Android List-Layer Drawable with VectorDrawable Text
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape>
<solid android:color="@android:color/white"/>
<corners android:radius="5dp"/>
</shape>
</item>
<item android:drawable="@drawable/vector"/>
</layer-list>
@soarez
soarez / ca.md
Last active May 3, 2024 00:04
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@jestan
jestan / gist:4411538
Last active September 25, 2023 19:58
MAP Protocol Error Codes

MAP Protocol Error Codes

Generic errors

34 System failure

35 Data Missing

36 Unexpected Data Value

21 Facility Not Supported

@arikfr
arikfr / .monitrc
Created December 13, 2010 14:35
Setting Monit to work with Gmail as mail server
set mailserver smtp.gmail.com port 587 username "user@domain.com" password "password" using tlsv1 with timeout 30 seconds