Skip to content

Instantly share code, notes, and snippets.

string $currentSelection[] = `ls -dag -r on -selection -flatten`;
select -d $currentSelection[0];
string $selection[];
int $num = 1;
int $n = 0;
int $unselected = 0;
float $percentage = 0.1;
string $each;
print($percentage + "\n");
@cyberroadie
cyberroadie / README.md
Created May 4, 2016 21:01 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@cyberroadie
cyberroadie / Maya.py
Created July 13, 2013 21:35
Sublime plugin for sending the content of your current file to Maya 3D. I Maya run the MEL command: commandPort -name ":6001"; This opens a port in Maya for receiving command which will be executed. The script in this Gist selects the contents of the file compresses it to a single line, removing empty lines and comments and sends it of the Maya.
import sublime, sublime_plugin, socket
HOST = '127.0.0.1' # the local host
PORT = 6001 # The same port as used by the server
ADDR=(HOST,PORT)
class MayaCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("select_all")
sels = self.view.sel()
@cyberroadie
cyberroadie / gist:3497102
Created August 28, 2012 10:44
Bash dialog
#!/bin/bash
dialog --menu "Choose: " 22 70 10 \
test1 blah1 \
test2 blah2 2> /tmp/dialog
choice=$(cat /tmp/dialog)
case $choice in
test1) echo "test 1";;
test2) echo "test 2";;
esac
@cyberroadie
cyberroadie / socket.h
Created August 27, 2012 17:55
Mac OS X standard socket.h file
/*
* Copyright (c) 2000-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
@cyberroadie
cyberroadie / gist:2267726
Created March 31, 2012 19:29
SCTP recvmsg system call in go
//sys sctp_generic_recvmsg(s int, iov *Iovec, iovlen int, from *RawSockaddrAny, addrlen *_Socklen, rsi uintptr, flags *int) (n int, err error)
func SCTPReceiveMessage(fd int, p []byte) (n int, sa Sockaddr, rsi *SCTPSndRcvInfo, flags int, err error) {
var rsa RawSockaddrAny
var length _Socklen = SizeofSockaddrAny
var iov Iovec
iov.Base = (*byte)(unsafe.Pointer(&p[0]))
iov.SetLen(len(p))
flags = 0