Skip to content

Instantly share code, notes, and snippets.

@simonspa
simonspa / gist:9909657
Last active August 29, 2015 13:57
Altera NIOS Code Compilation & Flash File Generation (CLI)
# How to compile NIOS code and produce Altera flash files
# Start a nios command line shell:
cd $HOME/altera/13.1/nios2eds/nios2_command_shell.sh
# Prepare and make the board support package:
cd $PROJECT/software/dtb_bsp/
nios2-bsp-generate-files --settings=settings.bsp --bsp-dir=.
make
@simonspa
simonspa / gist:058acb850f9ffab0d4dd
Created December 29, 2014 20:08
Saxon classpath for dt usermanual wp compilation
* Clean build directory
* set classpath:
```
export CLASSPATH=$CLASSPATH:/usr/share/java/docbook-xsl-saxon.jar:/usr/share/java/saxon-6.5.5.jar
```
* Run cmake:
```
cmake ..
```
* Build the usermanual:
@simonspa
simonspa / gist:a4251400d083103939ac
Created March 5, 2015 23:59
generate openssl self-signed certificate
sudo openssl req -x509 -new -days 1325 -newkey rsa:4096 -nodes -sha256 -out /etc/nginx/ssl/name.sha256.crt -keyout /etc/nginx/ssl/name.sha256.key
* 5 years validity (1325 days)
* SHA256 Signature
* 4096 bit RSA key
@arity(0,3,[int, int, int])
def do_wbcScan(self, minWBC = 90, maxWBC = 200, nTrigger = 50):
""" do_wbcScan [minWBC] [maxWBC] [nTrigger]: sets the values of wbc from minWBC until it finds the wbc which has more than 90% filled events or it reaches 255 (default minWBC 90)"""
self.api.daqTriggerSource("extern")
print "wbc \t#Events \texample Event"
wbcScan = []
for wbc in range (minWBC,maxWBC):
self.api.setDAC("wbc", wbc)
@simonspa
simonspa / gist:908f3fbd5a2d9ee102d33faf78715706
Created October 12, 2016 13:15 — forked from mackyle/gist:e11f34a92b53b07c8caf
ddclient always generate emails for IP updates & connect errors
commit 92149f8ee6cfb16c59a173395f5ae1749ce12c96
Author: Kyle J. McKay <[email protected]>
Date: Wed Jun 11 22:31:13 2014 -0700
Always send update & error messages to mail-failure address
diff --git a/ddclient b/ddclient
index 945745d0..671def55 100755
--- a/ddclient
+++ b/ddclient
https://github.com/masmu/pulseaudio-dlna
https://github.com/masmu/pulseaudio-dlna/issues/159#issuecomment-218463373
Method to analytically approximate the MPV of the Landau distribution, e.g. for charge deposited.
When filling histogram, fill with Moyal distribution instead of charge directly:
qMoyalvsxmym->fill( xmod, ymod, exp(- Q0 / 3.5) );
where 3.5 is a normalization factor corresponding to <>
After filling the histogram, rebin using
for(Int_t i = 1; i <= h->GetNbinsX(); i++) {
@simonspa
simonspa / Ubuntu_at_CERN.md
Created November 11, 2016 09:31 — forked from ansantam/Ubuntu_at_CERN.md
How to setup your Ubuntu @CERN

CERN Hacks

This Gist is a guide on how to setup your computer at CERN with Ubuntu 14.04 LTS. Last tested by myself on a brand new computer on 18/11/2014, proof tested by @Alea88.

NOTE (26-02-2015)

With the kernel upgrade from 3.13.0-45-generic to 3.13.0-46-generic AFS stops working: https://bugs.launchpad.net/ubuntu/+source/openafs/+bug/1423151

Type this to check your kernel version:

@simonspa
simonspa / rsync.sh
Created March 3, 2018 18:31
Fast rsync copy with no ssh compression and weak cipher
rsync -aHAXxv --numeric-ids --delete --progress -e "ssh -T -c arcfour -o Compression=no -x" /data/ root@hosy:/mnt/md0/data/