Skip to content

Instantly share code, notes, and snippets.

View gionn's full-sized avatar

Giovanni Toraldo gionn

View GitHub Profile
@gionn
gionn / gist:4564289
Created January 18, 2013 12:29
Bonnie++ on digitalocean.com VPS
root@gionn:~# bonnie++ -u nobody -c 2 -d /tmp
Using uid:65534, gid:65534.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
@gionn
gionn / gist:4737529
Last active December 12, 2015 07:38
Zimbra ignore invalid certificate

Zimbra: how to skip validation for self-signed or invalid certificates

Zimbra 8 will refuse to fetch emails from external accounts if the remote server is using a self-signed (or invalid) SSL certificate. Hence this is a good thing in terms of security, sometimes it isn't possible to control how external mail providers is handling their things.

This limitation is active even if "Use an encrypted connection (SSL) when accessing this server" isn't checked, since Zimbra will automatically use STARTTLS if detects that remote server support it.

$ sudo -i -u zimbra 
$ zmlocalconfig -e javamail_imap_enable_starttls=false
$ zmlocalconfig -e javamail_pop3_enable_starttls=false

$ zmmailboxdctl restart

@gionn
gionn / gist:4739763
Last active May 21, 2019 21:27
Zimbra: automatic fetching of external accounts.

Zimbra automatic fetching of external accounts

Zimbra 8 will not fetch automatically external POP3 or IMAP account. Use the following command to enable it! (every 5 minutes)

zmprov mc default zimbraDataSourcePollingInterval 5m

@gionn
gionn / gist:5024680
Created February 24, 2013 17:21
Acer TravelMate 5760Z (HuronRiver_CRB)
# Add acpi_backlight=vendor for brightness not working
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
# Fix for lag and packet loss on wifi - working on 3.2 stock kernel but not on 3.5 backported
07:00.0 Network controller: Atheros Communications Inc. AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
/etc/modprobe.d/ath9k.conf
options ath9k nohwcrypt=1
@gionn
gionn / DefaultController.java
Last active December 14, 2015 19:19
spring-mvc-json-example
package com.liberologico.cloudesire.cmw.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.liberologico.cloudesire.cmw.models.Entity;
@gionn
gionn / gist:6007641
Created July 16, 2013 10:39
OpenNebula working context for Ubuntu VM available on the marketplace
CONTEXT=[
ETH0_GATEWAY="$NETWORK[GATEWAY, NETWORK=\"loc\"]",
ETH0_IP="$NIC[IP, NETWORK=\"loc\"]",
ETH0_MASK="$NETWORK[NETWORK_MASK, NETWORK=\"loc\"]",
ETH0_DNS="$NETWORK[DNS, NETWORK=\"loc\"]",
ETH0_NETWORK="$NETWORK[NETWORK_ADDRESS, NETWORK=\"loc\"]",
TARGET="hda",
SSH_PUBLIC_KEY="yourkey"
]
@gionn
gionn / make_selfsigned_ssl_cert
Created September 26, 2013 19:43
Simple script to generate a self-signed certificate for a domain (use *.domain.tld for a wildcard certificate) to be used on webserver (apache2, nginx).
#!/bin/bash
openssl genrsa 2048 > host.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert
openssl x509 -noout -fingerprint -text < host.cert > host.info
cat host.cert host.key > host.pem
chmod 400 host.key host.pem
echo ## put on your nginx virtualhost ##
echo ssl on;
echo ssl_certificate /path/to/host.pem;
@gionn
gionn / lxc_mount_bind.md
Created November 21, 2013 16:49
How to enable bind mount inside lxc container

How to enable bind mount inside lxc container

When mount is returning:

STDERR: mount: block device /srv/database-data/postgres is write-protected, mounting read-only
mount: cannot mount block device /srv/database-data/postgres read-only

and dmesg shows:

@gionn
gionn / TATE.md
Last active April 1, 2018 18:36
Root and install cyanogenmod on Kindle Fire HD (2nd generation) codename tate
@gionn
gionn / jclouds-openstack.java
Last active August 29, 2015 14:01
JClouds OpenStack entercloudsuite.com
ComputeServiceContext context = ContextBuilder.newBuilder("openstack-nova")
.credentials(user, password)
.endpoint("https://api-legacy.entercloudsuite.com:5000/v2.0")
.modules(ImmutableSet.<Module> of(new SLF4JLoggingModule(),
new SshjSshClientModule()))
.buildView(ComputeServiceContext.class);
ComputeService computeService = context.getComputeService();
Template template = computeService.getTemplateBuilder()