Skip to content

Instantly share code, notes, and snippets.

@DavidePrincipi
DavidePrincipi / txinit.sh
Last active May 9, 2018 14:26
Initialize Transifex configuration
#!/bin/bash
#
# Copyright (C) 2015 Nethesis S.r.l.
# http://www.nethesis.it - nethserver@nethesis.it
#
# This script is part of NethServer.
#
# NethServer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@DavidePrincipi
DavidePrincipi / main.cf
Last active December 22, 2015 12:46
NethServer mail configuration for Office365 (experimental)
#
# 90smarthosts_accounts (template-custom)
# /etc/e-smith/templates-custom/etc/postfix/main.cf/90smarthosts_accounts
#
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/relaymaps
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
@DavidePrincipi
DavidePrincipi / phpini.diff
Created January 7, 2016 08:32
Differences on php.ini, between upstream and ns6
--- phpini.orig 2016-01-07 09:26:26.236391702 +0100
+++ phpini.ns6 2016-01-07 09:26:36.532286544 +0100
@@ -61,7 +61,7 @@
PHP Version => 5.3.3
Directive => Local Value => Master Value
-allow_call_time_pass_reference => Off => Off
+allow_call_time_pass_reference => On => On
allow_url_fopen => On => On
allow_url_include => Off => Off
[root@vm5 ~]# db networks show
br0=bridge
gateway=192.168.122.1
ipaddr=192.168.122.5
netmask=255.255.255.0
role=green
eth0=ethernet
FwInBandwidth=
FwOutBandwidth=
bridge=br0
@DavidePrincipi
DavidePrincipi / cloud-init.sh
Last active July 12, 2017 13:16
Configure NethServer 7 DC+VPNs on a dply.co VPS -- https://dply.co/b/h1hpfeRR
#!/bin/bash
export PATH="/sbin/e-smith:${PATH}"
NETWORKID=$(( $RANDOM % 32 + 103 ))
echo "Green network is 192.168.${NETWORKID}.0/24"
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
yum localinstall -y http://mirror.nethserver.org/nethserver/nethserver-release-7.rpm
---
sudo: required
env:
global:
- DOCKER_IMAGE=nethserver/makerpms
- NS_DIST_LATEST=${NS_DIST_LATEST:-7}
- PKG_BASE_URL=travisbot@packages.nethserver.org:nscom
services:
@DavidePrincipi
DavidePrincipi / isync
Last active November 8, 2023 14:44
Synchronize files remotely when changed locally (from a text editor)
#!/bin/bash
#
# Copyright (C) 2017 Davide Principi <davide.principi@nethesis.it>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
@DavidePrincipi
DavidePrincipi / README.md
Created February 6, 2018 13:58
Merge %changelog from multiple spec files and sort entries by date

sort-changelog.sh

Merge changelogs from multiple RPM files and sort entries by date

$ bash sort-changelog.sh file1.rpm file2.rpm [...]
@DavidePrincipi
DavidePrincipi / CentOS-7.5.1804-Minimal_packages.lst
Created May 10, 2018 15:11
This is the list of RPMs at first boot of CentOS-7-x86_64-Minimal-1804.iso
acl-2.2.51-14.el7.x86_64
aic94xx-firmware-30-6.el7.noarch
alsa-firmware-1.0.28-2.el7.noarch
alsa-lib-1.1.4.1-2.el7.x86_64
alsa-tools-firmware-1.1.0-1.el7.x86_64
audit-2.8.1-3.el7.x86_64
audit-libs-2.8.1-3.el7.x86_64
authconfig-6.2.8-30.el7.x86_64
basesystem-10.0-7.el7.centos.noarch
bash-4.2.46-30.el7.x86_64
@DavidePrincipi
DavidePrincipi / fix-ns7-ldapacl.ldif
Created July 4, 2018 14:07
The default LDAP ACL for the front DB wasn't set correctly in a system upgraded from sme8-ns6-ns7
dn: olcDatabase={-1}frontend,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to attrs=userPassword by
dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage by
dn.exact="cn=libuser,dc=directory,dc=nh" peername.ip="127.0.0.1" write by self
write by * peername.ip="127.0.0.1" auth by * ssf=71 auth by * none
olcAccess: {1}to * by
dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage by
dn.exact="cn=libuser,dc=directory,dc=nh" peername.ip="127.0.0.1" write by *