Skip to content

Instantly share code, notes, and snippets.

View bomale's full-sized avatar
😛

Alessandro bomale

😛
View GitHub Profile
@tach
tach / Synology_NAS_Tips.md
Last active May 10, 2021 21:06
My tips using Synology NAS (DS215j)

Synology NAS Tips

Shell operation tips

Password of root is same as administrator account as you created on setup.

How to change shell prompt

PS1="\u@\h:\w$ "
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebPage",
"name": "About Patrick",
"description": "In addition to Patrick's work in the SEO field, he also enjoys classical jazz dancing and organic farming ",
"publisher": {
"@type": "ProfilePage",
"name": "Patrick's Website"
}
@odan
odan / xampp_php7_xdebug.md
Last active July 25, 2024 23:01
Installing Xdebug for XAMPP
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active July 14, 2024 19:55
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@ndunks
ndunks / ddns-update
Last active January 17, 2021 03:23
Namecheap DDNS Updater Bash Script
# make it executable `chmod +x ddns-update`
# move it path `mv ddns-update /usr/bin/`
# setup cronjob for every 15 minutes `crontab -e`
# */15 * * * * ddns-update >/dev/null 2>&1
# dont forget to change your own domain & password
# uncomment if you want internet connection check before running
#while ! ping -c 1 -W 1 8.8.8.8; do
# echo "DDNS-UPDATE: Waiting internet connection.."
# sleep 2
const intersectionObserver = new IntersectionObserver((entries, observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
// element is in viewport, do the stuff
// it's good to remove observer,
// if you don't need it any more
observer.unobserve(entry.target);
}
});
@leeoniya
leeoniya / letsencrypt_2017.md
Created December 31, 2017 02:54 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@tanaikech
tanaikech / submit.md
Created January 19, 2018 01:13
Batching Requests for Google Apps Script

Batching Requests for Google Apps Script

There is the bathing requests in the Google APIs. The bathing requests can use the several API calls as a single HTTP request. By using this, for example, users can modify filenames of a lot of files on Google Drive. But there are limitations for the number of API calls which can process in one batch request. For example, Drive API can be used the maximum of 100 calls in one batch request.

The following sample script modifies the filenames of 2 files on own Google Drive using Google Apps Script. Drive API for modifying filenames is used as "PATCH". The batch request including 2 API calls of Drive API is called using "multipart/mixed". If you want more APIs, please add the elements to the array of "body".

function main() {
  var body = [
    {
 method: "PATCH",
@shtrom
shtrom / fritz_cert_upload.py
Last active March 12, 2023 17:01
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
#!/usr/bin/env python3
# vim: fileencoding=utf-8
"""
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
Copyright (C) 2018--2021 Olivier Mehani <shtrom@ssji.net>
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 2 of the License, or
(at your option) any later version.
describe("Dashboard Page", async() => {
it("Login as Basic", async() => {
await page.goto(baseUrl, {waitUntil: "networkidle0"})
await page.click(".login-btn")
await page.waitForSelector('app-login form > input:nth-child(2)')
await page.type('app-login form > input:nth-child(2)', process.env.USERNAME)
await page.type('app-login form > input:nth-child(4)', process.env.PASSWORD)
await page.click('app-login form > button')
await page.waitForSelector('div.content-container > swiper')
})