Skip to content

Instantly share code, notes, and snippets.

View Myzel394's full-sized avatar

Myzel394

View GitHub Profile
@sagehane
sagehane / books.md
Last active August 6, 2024 18:22
List of books I'm interested in
@Fanna1119
Fanna1119 / countries.js
Created October 2, 2022 15:13
object literal for country info using ISO 2 as key
const c = {
"AF": {
"Country": "Afghanistan",
"Alpha-2 code": "AF",
"Alpha-3 code": "AFG",
"Numeric code": 4,
"Latitude (average)": 33,
"Longitude (average)": 65,
"emoji_flag": "🇦🇫"
},
@sjgallagher2
sjgallagher2 / basic-embedded-c.c
Last active September 17, 2024 15:30
A get-started-fast guide to embedded C
/*
* In embedded systems, the C programming language is most often the language of choice. For more intensive
* elements in the system, assembly can be used. Embedded C is distinct from typical C programming in its
* requirements for efficiency, its limited resources, and its unique hardware problems which are much less common in
* the majority of C programs. Even still, the language itself is the same, so check out K&R's The C Programming
* Language and other reference books.
*
* Some of the problems central to embedded systems programming:
* - Memory management
* - Register access and manipulation
@guettli
guettli / ssh-tunnel@.service
Created December 22, 2017 11:40
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/guettli/31242c61f00e365bbf5ed08d09cdc006#file-ssh-tunnel-service
[Unit]
Description=Tunnel for %i
After=network.target
[Service]
User=tunnel
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i
@ageis
ageis / systemd_service_hardening.md
Last active September 5, 2024 09:52
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@tadast
tadast / countries_codes_and_coordinates.csv
Last active September 22, 2024 18:02
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Åland Islands AX ALA 248 60.116667 19.9
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
@kjellski
kjellski / sshd_config
Created July 6, 2013 18:59
This is an example real-world sshd_config with a nice little example at the end. A match clause that enables different setting for specific ranges than general settings...
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
@djangofan
djangofan / test.xml
Created July 27, 2012 04:46
XML file sample
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root testAttr="testValue">
<result>
<child>data1</child>
<child>A1343358848.646</child>
<child>
<internal>
<data>one</data>
<data>two</data>
<unique>Z1343358848.646</unique>