Skip to content

Instantly share code, notes, and snippets.

View marc-hanheide's full-sized avatar
💭
coding?

Marc Hanheide marc-hanheide

💭
coding?
View GitHub Profile
@marc-hanheide
marc-hanheide / lcas-bib-export-generator.py
Last active March 21, 2022 14:21
How to create the bibtex export URL for eprints for L-CAS
#!/usr/bin/env python
# old URL using IDs that is NOT working reliably:
# http://eprints.lincoln.ac.uk/cgi/search/archive/advanced/export_lirolem_BibTeX.bib?screen=Search&dataset=archive&_action_export=1&output=BibTeX&exp=0%7C1%7C-date%2Fcreators_name%2Ftitle%7Carchive%7C-%7Ccreators_id%3Acreators_id%3AANY%3AIN%3A002146+801704+801872+801929+003092+002165+001928+802799+002604+504752+504299+002325%7Ctype%3Atype%3AANY%3AEQ%3Aarticle+review+book_section+monograph+conference_item+book+thesis+dataset%7C-%7Ceprint_status%3Aeprint_status%3AANY%3AEQ%3Aarchive%7Cmetadata_visibility%3Ametadata_visibility%3AANY%3AEQ%3Ashow&n=
staff = [
'Hanheide, Marc',
'Duckett, Tom',
'Sklar, Elizabeth',
@marc-hanheide
marc-hanheide / fix-network.sh
Last active February 12, 2018 14:04
a cronjob to fix the network using rfkill
#!/bin/bash
## add this to cron as * * * * * /home/turtlebot/fix-network.sh
if ping -W 5 -c 1 10.82.0.1 > /dev/null; then
true
else
rfkill block wifi
#sleep 1
#rmmod iwldvm iwlwifi
@marc-hanheide
marc-hanheide / etc_default_sshl
Created December 4, 2017 17:13
Some useful sslh configuration
# Default options for sslh initscript
# sourced by /etc/init.d/sslh
# Disabled by default, to force yourself
# to read the configuration:
# - /usr/share/doc/sslh/README.Debian (quick start)
# - /usr/share/doc/sslh/README, at "Configuration" section
# - sslh(8) via "man sslh" for more configuration details.
# Once configuration ready, you *must* set RUN to yes here
# and try to start sslh (standalone mode only)
@marc-hanheide
marc-hanheide / imap.py
Created September 7, 2017 15:01
imap tests with Python
from imaplib import IMAP4_SSL
from email import message_from_string
from getpass import getpass
from json import dumps
from pprint import pprint
def parse_email(raw_email):
email = message_from_string(raw_email)
# print email.items()
@marc-hanheide
marc-hanheide / build.log
Created July 13, 2017 18:58
error in ConditionScanner
[ 5%] Building CXX object CMakeFiles/pnp.dir/home/marc/spqrel/spqrel_launch/worktree/PetriNetPlans/PNP/src/parser/ConditionScanner.cpp.o
ConditionScanner.cpp: In member function 'virtual int yyFlexLexer::yylex()':
ConditionScanner.cpp:561:9: error: no match for 'operator=' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'std::istream* {aka std::basic_istream<char>*}')
ConditionScanner.cpp:561:9: note: candidate is:
In file included from /opt/naoqi/ctc-linux64-atom-2.5.2.74/i686-aldebaran-linux-gnu/include/c++/4.9.2/iostream:40:0,
from ConditionScanner.cpp:96:
/opt/naoqi/ctc-linux64-atom-2.5.2.74/i686-aldebaran-linux-gnu/include/c++/4.9.2/istream:58:11: note: std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&) <deleted>
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/opt/naoqi/ctc-linux64-atom-2.5.2.74/i686-aldebaran-linux-gnu/include/c++/4.9.2/istream:58:11: note: no known conversion for argu
@marc-hanheide
marc-hanheide / install-SPQReL.sh
Created July 13, 2017 10:47
A full log of installation for SPQReL
# prior to this install naoqi SDKs in /opt/naoqi is shown in https://sites.google.com/a/dis.uniroma1.it/peppino/software-setup
qitoolchain create linux64 /opt/naoqi/naoqi-sdk-2.5.5.5-linux64/toolchain.xml
qitoolchain create pepper /opt/naoqi/ctc-linux64-atom-2.5.2.74/toolchain.xml
sudo apt-get install python-pip
sudo pip install qibuild
# install opencv over existing naoqi SDK again, as described in https://github.com/LCAS/spqrel_navigation/wiki/NAOQI-Installation-and-Usage#prepare-a-specific-opencv-version
# setup your git if you haven't done so, e.g.
@marc-hanheide
marc-hanheide / steps.sh
Created July 10, 2017 16:54
SPQReL steps to make it work
git clone https://github.com/lcas/spqrel_tools.git
git clone https://github.com/iocchi/PetriNetPlans.git
cd PetriNetPlans/PNP
mkdir build
cd build
cmake ..
make -j8
cd ../../PNPnaoqi/
@marc-hanheide
marc-hanheide / arp-scan-hosts.sh
Created March 28, 2017 09:14
ARP scan to create /etc/hosts
#!/bin/bash
set -e
grep -v 'mac.local #DYN' /etc/hosts > /etc/hosts.new
arp-scan --localnet -qg |
grep ':..:..:..:..:' |
sed -e 's/:/_/g' -e 's/$/.mac.local #DYN/' >> /etc/hosts.new
[ -s /etc/hosts.new ] && {
@marc-hanheide
marc-hanheide / install-openvpn-client-turtlebot.sh
Last active February 9, 2017 10:10
Install VPN client for turtlebot communication
#!/bin/bash
sudo apt-get update
sudo apt-get -y install network-manager-openvpn-gnome
wget https://gist.github.com/marc-hanheide/21ec39c7403983f23fa13175c7ecb6fb/raw/7a170d0da13ec71fc7bad2c4778c6904e92dcf8c/openvpn-client.zip
unzip -d openvpn-turtlebot openvpn-client.zip
@marc-hanheide
marc-hanheide / install-turtlebot-vpn-server.sh
Last active February 9, 2017 10:01
Install VPN on our turtlebot
#!/bin/bash
sudo apt-get update
sudo apt-get -y install openvpn
cd ~
wget https://gist.github.com/marc-hanheide/21ec39c7403983f23fa13175c7ecb6fb/raw/7a170d0da13ec71fc7bad2c4778c6904e92dcf8c/openvpn-server.tgz
cd /etc
sudo tar xf ~/openvpn-server.tgz
sleep 2
sudo service openvpn restart