Skip to content

Instantly share code, notes, and snippets.

View khurshid-alam's full-sized avatar

Khurshid Alam khurshid-alam

View GitHub Profile
@Peregrinox
Peregrinox / dependable mount with systemd.md
Last active October 5, 2024 20:41
Use Systemd mount units to mount partitions that depend on previous init tasks

https://oguya.ch/posts/2015-09-01-systemd-mount-partition/ https://unix.stackexchange.com/questions/246935/set-systemd-service-to-execute-after-fstab-mount

This started because the fuse mounts on /etc/fstab didn´t process right the "nofail" options and the init of the server will fail if external drive are not present. So I need some alternative command to "dependable" automount some folders or partitions.

find the service that auto-mounts your device

systemctl list-units | grep '/media/Elements' | awk '{ print $1 }'
@rel
rel / collect_notes.scpt
Created December 19, 2017 15:57
A simple AppleScript (written in javascript) to collect notes from Apple Notes into a single html document for easy printing.
// options
var startDate = new Date(2017, 10, 1); // the start date for notes collection. Remember, in js January = 0.
var fileName = "notes.htm"; // the name of the file to create
// use the notes app
var notes = Application("notes");
var collected = [];
// collect notes modified after the start date
for(var i in notes.notes) {
log-format '{"host":"%H","ident":"haproxy","pid":%pid,"time":"%Tl","haproxy":{"conn":{"act":%ac,"fe":%fc,"be":%bc,"srv":%sc},"queue":{"backend":%bq,"srv":%sq},"time":{"tq":%Tq,"tw":%Tw,"tc":%Tc,"tr":%Tr,"tt":%Tt},"termination_state":"%tsc","retries":%rc,"network":{"client_ip":"%ci","client_port":%cp,"frontend_ip":"%fi","frontend_port":%fp},"ssl":{"version":"%sslv","ciphers":"%sslc"},"request":{"method":"%HM","uri":"%[capture.req.uri,json(utf8s)]","protocol":"%HV","header":{"host":"%[capture.req.hdr(0),json(utf8s)]","xforwardfor":"%[capture.req.hdr(1),json(utf8s)]","referer":"%[capture.req.hdr(2),json(utf8s)]"}},"name":{"backend":"%b","frontend":"%ft","server":"%s"},"response":{"status_code":%ST,"header":{"xrequestid":"%[capture.res.hdr(0),json(utf8s)]"}},"bytes":{"uploaded":%U,"read":%B}}}'
@Philip-Scott
Philip-Scott / VideoPlayer.vala
Last active October 22, 2020 18:20
ClutterGStreamer & Gtk video player widget in Vala
/*-
* Copyright (c) 2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
{
"id": "org.freedesktop.Platform.Icontheme.Paper",
"branch": "1.0",
"runtime": "org.freedesktop.Sdk",
"build-extension": true,
"sdk": "org.freedesktop.Sdk",
"runtime-version": "1.6",
"sdk-extensions": [],
"separate-locales": false,
"cleanup": [ "/share/info", "/share/man" ],
@jasonnemesis
jasonnemesis / IIS_Cipher_Suites_and_TLS_Config.md
Last active June 29, 2023 04:12
IIS Cipher Suites and TLS Configuration

IIS Cipher Suites and TLS Configuration

Change SSL Cipher Suite Order

gpedit.msc

    Computer Configuration > Administrative Templates > Network > SSL Configuration Settings > SSL Cipher Suite Order
    Enable

Recommended (MS Equivalent syntax of Mozilla Intermediate from https://mozilla.github.io/server-side-tls/ssl-config-generator/):

@JavadocMD
JavadocMD / chrome_open_bookmark.py
Created November 12, 2016 00:18
A script to open Chrome bookmarks or entire folders of bookmarks by name. (Windows)
#!/usr/bin/env python
import os, subprocess, json
# Get all bookmarks matching the given name(s)
def get_bookmarks(profile_dir, names):
with open(os.path.join(profile_dir, 'Bookmarks')) as f:
j = json.load(f)
results = []
# There are two root-level bookmark folders: one for the bookmark bar and one for all others.
@tcarrondo
tcarrondo / syncevolution_generic_caldav.sh
Last active July 30, 2020 08:28
Script simples para sincronizar um caledário caldav com o Ubuntu Touch. Adiciona a configuração do calendário de forma independente e adiciona uma tarefa automática para que ele sincronize periodicamente.
#!/bin/bash
# Simplified by me, Tiago Carrondo <[email protected]>
# Thanks to: Romain Fluttaz <[email protected]>
# Thanks to: Wayne Ward <[email protected]>
# Thanks to: Mitchell Reese <[email protected]>
# --------------- [ Server ] ---------------- #
CAL_URL=" " # add the caldav URL here
USERNAME=" " # you know this one
PASSWORD=" " # lots of ******
@theUncanny
theUncanny / ppainstall.sh
Created May 14, 2016 19:02 — forked from rrevanth/ppainstall.sh
Elementary OS PPA script
#!/bin/bash
# Fixes sudo issues
if (($EUID != 0)); then
if [[ -t 1 ]]; then
sudo "$0" "$@"
else
exec 1>output_file
gksu "$0 $@"
fi
@ivan-loh
ivan-loh / request.lua
Created November 16, 2015 04:21
sample lua http get
local http = require "socket.http"
local data = ""
local function collect(chunk)
if chunk ~= nil then
data = data .. chunk
end
return true
end