Skip to content

Instantly share code, notes, and snippets.

Avatar

Janek Lasocki-Biczysko janeklb

View GitHub Profile
@janeklb
janeklb / nmcli_vpn.bash
Created Aug 21, 2021
Importin openvpn connections into network manager on (x)ubuntu
View nmcli_vpn.bash
# install openvpn network manager
# `network-manager-openvpn-gnome` is required for password management + interation with keyring
sudo apt install network-manager network-manager-openvpn network-manager-openvpn-gnome
# import .ovpn file into network manager
nmcli connection import type openvpn file <PATH-TO-OVPN-FILE>
# set username
nmcli connection modify openvpn-connection +vpn.data username=<USERNAME>
# set password
nmcli connection modify openvpn-connection +vpn.secrets password=<PASSWORD>
@janeklb
janeklb / .bash_profile
Created Aug 3, 2017 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@janeklb
janeklb / install_unoconv_0.7.sh
Created Jul 27, 2016
install unoconv 0.7 on debian jessie
View install_unoconv_0.7.sh
# Add unstable repo to sources.list
# meaning, add the following lines (and uncomment) to /etc/apt/sources.list:
# deb http://http.us.debian.org/debian unstable main non-free contrib
# deb-src http://http.us.debian.org/debian unstable main non-free contrib
gpg --export --armor 8514CC63 | apt-key add - && apt update # might not be needed
apt-get build-dep unoconv
cd /usr/src
@janeklb
janeklb / WroWriter.java
Last active Dec 28, 2015
Attempting to programatically write a Wro4j resource group to a file
View WroWriter.java
package com.intrallect.amauthor.wro4j;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.annotation.PostConstruct;
import javax.servlet.FilterConfig;
@janeklb
janeklb / deploy.sh
Last active Dec 24, 2015
Easy peezy deploy from a git repo using rsync
View deploy.sh
#!/bin/sh
# heavily inspired by http://wildlyinaccurate.com/deploying-a-git-repository-to-a-remote-server (and comments)
ref=master # git ref
prefix=deploy_in_prog/ # just a temp name
tmp_dir=/tmp
remote_dir=/var/www # the remote directory
remote_host=user@host # the remote host
@janeklb
janeklb / gist:5546011
Last active Dec 17, 2015
AngularJS '&' directive scope - 2
View gist:5546011
<div ng-app="myApp" ng-controller="myController">
<div my-clicky my-click-action="doStuff(number)"></div>
</div>
@janeklb
janeklb / gist:5544464
Last active Dec 17, 2015
AngularJS '&' directive scope - 1
View gist:5544464
<div ng-app="myApp" ng-controller="myController">
<div my-clicky my-click-action="doStuff()"></div>
</div>
@janeklb
janeklb / gist:4761535
Last active Sep 4, 2020
PHP: array to object
View gist:4761535
<?php
# Simple loop copy
function loop_copy($array) {
$object = new stdClass();
foreach ($array as $key => $value) {
$object->$key = $value;
}
}
@janeklb
janeklb / gist:4650320
Created Jan 27, 2013
create javascript date objects using date strings, in the user's timezone
View gist:4650320
function dateInLocalTimezone(simpleDateString) {
var date = new Date(simpleDateString), millis = date.getTime();
date.setTime(millis + date.getTimezoneOffset() * 60 * 1000);
return date;
}
@janeklb
janeklb / gist:2761327
Created May 21, 2012
Bootstrap (v2.0.3) tooltip issue
View gist:2761327
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" />
</head>
<body style="padding: 60px 0;">
<div style="float:right;">
<a class="btn tt" title="Yaaaaaaaaaaay, this longer tooltip works.. kinda">:)</a>
<a class="btn tt" title="Boooooooooooo, this longer tooltip is broken..">:(</a>