Skip to content

Instantly share code, notes, and snippets.

@abruneau
abruneau / Centos_macbook_wifi_setup.sh
Created April 29, 2016 14:51
Setup wifi for Centos 7 installation on Macbook
sudo yum group install 'Development Tools'
sudo yum install redhat-lsb kernel-abi-whitelists
sudo yum install kernel-devel-$(uname -r)
mkdir -p ~/rpmbuild/{BUILD,RPMS,SPECS,SOURCES,SRPMS}
echo -e "%_topdir $(echo $HOME)/rpmbuild\n%dist .el$(lsb_release -s -r|cut -d"." -f1).local" >> ~/.rpmmacros
wget http://elrepo.org/linux/elrepo/el7/SRPMS/wl-kmod-6_30_223_271-2.el7.elrepo.nosrc.rpm
wget http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
mv hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz ~/rpmbuild/SOURCES/
@abruneau
abruneau / install_openconnect_centos7.sh
Created April 29, 2016 14:55
Install open connect on Centos 7
sudo yum install epel-release
sudo yum install NetworkManager-openconnect
export JDK_URL=http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-x64.rpm
export JDK_FILE=$(basename $JDK_URL)
yum -y install wget
echo "Downloading from $JDK_URL as $JDK_FILE"
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" $JDK_URL -O /tmp/$JDK_FILE
rpm -ivh /tmp/$JDK_FILE
rm -f /tmp/$JDK_FILE
DIR=$(dirname $0)
@abruneau
abruneau / snippet.scpt
Last active September 28, 2017 15:27
List Folder notes #jxa #AppleNotes
const Notes = Application('Notes')
const folder = Notes.folders.whose({
name: 'Astellia'
})[0]
return folder.notes().map((n) => {
return {
name: n.name(),
id: n.id(),
@abruneau
abruneau / export-evernotes.applescript
Created October 2, 2017 09:12 — forked from sudocode/export-evernotes.applescript
JXA script for exporting Evernotes to Apple Notes
/* Developed by Daniel Park (github.com/sudocode).
*
* Free for personal or commercial use, with or without modification.
* No warranty is expressed or implied.
*/
var App = Application.currentApplication(),
Evernote = Application('Evernote'),
Notes = Application('Notes')
@abruneau
abruneau / randombg.js
Created November 16, 2017 16:27 — forked from aloncarmel/randombg.js
Grab a random background from unsplash.com and apply to a div.
function GetRandomBackground()
{
var url = 'http://unsplash.com/rss';
$.ajax({
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url),
async: false,
jsonpCallback: 'jsonCallback',
contentType: "application/json",
@abruneau
abruneau / hidenuseradd.sh
Last active July 1, 2019 13:44 — forked from igorvoltaic/useradd.sh
Create new user using command line in Mac OS X. Do not forget to set correct permissions for the file.
#!/bin/sh
if [[ `id -u` != 0 ]]; then
echo "Must be root to run script"
exit
fi
read -p "Enter user name and press [ENTER]: " UserName
if [[ $UserName == `dscl . -list /Users UniqueID | awk '{print $1}' | grep -w $UserName` ]]; then