Skip to content

Instantly share code, notes, and snippets.

View cisano-arelia's full-sized avatar
🤔
The menu is not the meal

C'isano Arelia cisano-arelia

🤔
The menu is not the meal
  • Netherlands
View GitHub Profile
@cisano-arelia
cisano-arelia / INSTALLATION
Last active February 28, 2023 11:57
Promtail Client Install
sudo useradd --system promtail
sudo setfacl -R -m u:promtail:rX /var/log
sudo usermod -a -G systemd-journal promtail
sudo mkdir -p /usr/local/etc
sudo wget -O /usr/local/etc/promtail.yaml https://gist.github.com/cisano-arelia/7aedd192ba1bb11b43c12254b15d481a/raw/promtail.yaml
sudo wget -O /etc/systemd/system/promtail.service https://gist.github.com/cisano-arelia/7aedd192ba1bb11b43c12254b15d481a/raw/promtail.service
sudo wget -O /tmp/promtail.zip https://github.com/grafana/loki/releases/download/v2.7.4/promtail-linux-amd64.zip
sudo unzip /tmp/promtail.zip -d /usr/local/bin
sudo systemctl enable --now promtail
@cisano-arelia
cisano-arelia / docker-compose.yml
Created November 18, 2022 13:14
docker compose Portainer + Agent + Traefik + Letsencrypt DNS with Cloudflare
version: "3.4"
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
command:
- --providers.docker=true
- --api.dashboard=false
@cisano-arelia
cisano-arelia / sshd_config
Last active May 13, 2023 12:06
Hardened SSHD_CONFIG
# Name: K4YT3X Hardened OpenSSH Configuration
# Author: K4YT3X
# Date Created: October 5, 2020
# Last Updated: November 20, 2020
# Licensed under the GNU General Public License Version 3 (GNU GPL v3),
# available at: https://www.gnu.org/licenses/gpl-3.0.txt
# (C) 2020 K4YT3X
# SSH server listening address and port
frontend ssl
mode tcp
bind 0.0.0.0:443 name frontend-ssl
option tcplog
log global
tcp-request inspect-delay 3s
tcp-request content accept if { req.ssl_hello_type 1 }
use_backend main-ssl if { req.ssl_hello_type 1 }
use_backend ssh if !{ req.ssl_hello_type 1 } { payload(0,7) -m bin 5353482d322e30 }
use_backend openvpn if !{ req.ssl_hello_type 1 } !{ req.len 0 }
@cisano-arelia
cisano-arelia / adMemberOf.ldif
Last active September 15, 2022 11:10
ADS sAMAccountName + memberOF + openSSHPublicKey
dn: cn=microsoft, ou=schema
objectclass: metaSchema
objectclass: top
cn: microsoft
dn: ou=attributetypes, cn=microsoft, ou=schema
objectclass: organizationalUnit
objectclass: top
ou: attributetypes
@cisano-arelia
cisano-arelia / install ldapd
Last active September 15, 2022 08:45
debian ldap
apt install libnss-ldapd libpam-ldapd
dpkg-reconfigure libpam-runtime (if needed)
@cisano-arelia
cisano-arelia / cmdline.txt
Last active July 4, 2022 17:31
Raspberry PI Zero OTG Network
console=serial0,115200 console=tty1 root=PARTUUID=c36e454f-02 rootfstype=ext4 fsck.repair=yes rootwait modules-load=dwc2,g_ether
  • Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
  • Installation date: 16-08-2019
  • Additional notes based on my own experience
  • EFI boot
  • Ubuntu 19.04
  • This should work on any computer. Only the RAID > AHCI change described below and the device name for the nvme ssd drive are specific to this laptop.
  • The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  • The process was conducted on Dell's XPS 15 9560 (2017) with specs:
  • CPU: i7-7700HQ
@cisano-arelia
cisano-arelia / apex controller
Created October 26, 2017 08:33
KvKProfile lightning component
public class KvKProfile {
@AuraEnabled
public static String getProfile (Id recordId) {
Account acc = [select kvk__c from account where id=:recordId];
return getHttp('https://api.kvk.nl/api/v2/testprofile/companies?kvkNumber='+acc.kvk__c);
}
private static String getHttp (String url) {
HttpRequest req = new HttpRequest();
Http http = new Http();
@cisano-arelia
cisano-arelia / apex controller
Last active October 24, 2017 13:25
In the Area component
public class InTheArea {
@AuraEnabled
public static String getLocal (String searchTerm, Decimal lat, Decimal lon) {
String url = 'https://th-yelp-locator.herokuapp.com/search?address=' + lat +','+ lon + '&term=' + EncodingUtil.urlEncode(searchTerm, 'UTF-8');
String resultList = getHttp(url);
return resultList;
}
private static String getHttp (String url) {
HttpRequest req = new HttpRequest();