Skip to content

Instantly share code, notes, and snippets.

cvcore

  • Uni-Freiburg
Block or report user

Report or block cvcore

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cvcore
cvcore / custom-vpn.service
Created Jun 29, 2018
Custom VPN systemd unit (place under /etc/systemd/system/custom-vpn.service)
View custom-vpn.service
[Unit]
Description=Custom VPN
After=network.target auditd.service
[Service]
Type=forking
ExecStart=/opt/scripts/vpn_dns_update.sh daemon
ExecStop=/opt/scripts/vpn_dns_update.sh daemon-kill
PIDFile=/var/run/momenta-vpn.pid
RemainAfterExit=True
@cvcore
cvcore / vpn_dns_update.sh
Created Jun 29, 2018
Automatic openconnect VPN connection
View vpn_dns_update.sh
#!/bin/bash
# needs to run as root
# THIS SAMPLE CODE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PAGERDUTY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) SUSTAINED BY YOU OR A THIRD PARTY, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING IN ANY WAY OUT OF THE USE OF THIS SAMPLE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Configurations
VPN_USER=
VPN_PWD=
VPN_SERVER=
HOSTNAME=
View ros_time_diff.cpp
#include <ros/ros.h>
#include <momenta_msgs/TimeSync.h>
#include <iostream>
ros::Time t_local;
ros::Time t_remote;
void time_callback(const momenta_msgs::TimeSync& time)
{
t_local = ros::Time::now();
@cvcore
cvcore / px2_git_lfs.sh
Last active Jun 20, 2018
install git lfs on PX2 (aarch64)
View px2_git_lfs.sh
#!/bin/bash
# install go
mkdir -p ~/Downloads && cd ~/Downloads
wget https://dl.google.com/go/go1.9.4.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.9.4.linux-arm64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# install git-lfs
@cvcore
cvcore / px2_ros_install.sh
Last active Sep 14, 2018
NVIDIA Drive PX 2 ROS Installation
View px2_ros_install.sh
#!/bin/bash
# taken from https://devtalk.nvidia.com/default/topic/1011002/cross-compiling-driveworks-on-the-px2-with-ros/
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# this is crucial
sudo apt-get install libssl1.0.0/xenial libssl-doc/xenial libssl-dev/xenial
@cvcore
cvcore / org-fragment-auto-preview.el
Last active Apr 12, 2018
Automatic fragment toggling in org-mode
View org-fragment-auto-preview.el
;;
;; 28.07.2017
;; Charles Wang
;;
;;;;;;; Tweaks for Org & org-latex ;;;;;;
(defvar cw/org-last-fragment nil
"Holds the type and position of last valid fragment we were on. Format: (FRAGMENT_TYPE FRAGMENT_POINT_BEGIN)"
)
You can’t perform that action at this time.