Skip to content

Instantly share code, notes, and snippets.

@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 "[email protected]" password "password" using tlsv1 with timeout 30 seconds
@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

@soarez
soarez / ca.md
Last active April 15, 2025 12:46
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.

@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>
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active July 7, 2024 19:47
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:

@SerafimArts
SerafimArts / Annotation.js
Last active January 11, 2025 11:08
JavaScript Annotations example
import Reader from './Reader';
import Target from './Target';
/**
* This is default annotation property for automatic type casting:
* <code>
* @Annotation({ some: any })
* // => will be casts "as is" {some: any}
*
* @Annotation("any")
@guy4261
guy4261 / niqqud.py
Last active March 6, 2025 17:57
Hebrew niqqud unicode point values for Python programmers
# To create a hebrew letter with niqqud:
# hebrew letter [+ optional shin_dot if letter is shin] [+ optional dagesh] [+ optional niqqud]
# example: print("ש" + chr(shin_dot_right_shin) + chr(dagesh) + chr(kmz_katan)) => שָּׁ
# letter should be first, order of the rest does not matter
# print("ש" + chr(kmz_katan) + chr(shin_dot_left_sinn) + chr(dagesh)) => שָּׂ
# This is how you get things like the reverse of noël being l̈eon instead of lëon,
# as discussed in Edaqa Mortoray's two seminal blog posts:
# https://mortoray.com/we-dont-need-a-string-type/