Skip to content

Instantly share code, notes, and snippets.

@priyadarshan
priyadarshan / New-RulesFromNetstat.ps1
Last active January 9, 2018 12:55 — forked from jeffpatton1971/New-RulesFromNetstat.ps1
A script to create firewall rules based on netstat output
<#
Create FW rules for TCP and UDP Listening Ports
netstat -an -p tcp |Select-String "Listening"
netstat -an -p udp |Select-String "Listening"
for each entry in netstat create firewall rule
name = -p tcp|udp port port #
description = automatic allow rule generated by powershell on get-date
@fukamachi
fukamachi / common-lisp-scripting-with-roswell.md
Last active April 10, 2021 16:39
Common Lisp Scripting with Roswell (Draft)

Common Lisp Scripting with Roswell

"Roswell Script" is implementation-independent Common Lisp scripting program which uses Roswell. Although Roswell itself is a unified interface to Common Lisp implementations, it also encourages writing scripts with it.

To start writing it, run ros init in your terminal:

$ ros init
Usage: ros init [template] name [options...]
@fukamachi
fukamachi / using-travis-ci-with-roswell.md
Last active May 28, 2021 03:36
Using Travis CI with Roswell

Using Travis CI with Roswell

Travis CI is the most prevalent cloud CI service. Though it has no Common Lisp support officially, by using Roswell, you can test your Common Lisp product with a few efforts.

WARNING: This document is based on Roswell v0.0.3.42 (not released yet) or above.

Enabling Travis CI

To use Travis CI, you must sign up and enable testing for your repository at your profile page.

@shortsightedsid
shortsightedsid / multiplication-tables.lisp
Last active March 24, 2019 19:00
Print Multiplication Tables
;; Print Multiplication Tables
;;
;; This demonstrates CL's format function and it's ability
;; to print out Roman Numerals, Numbers in Words etc..
;;
;; Unlikely to be ever used!
(defun multiplication-table (number)
(loop for i from 1 below 12
do (format t "~10<~@r~;times~> ~:d = ~r~%" i number (* i number))
@fukamachi
fukamachi / which.lisp
Created July 4, 2015 19:32
which -- check if a command is available on the working environment
(defun which (command)
(handler-case
(let* ((result (with-output-to-string (s)
(uiop:run-program `("which" ,command)
:output s
:error-output *error-output*)))
(newline-pos
(position-if (lambda (char)
(or (char= char #\Newline)
(char= char #\Return)))
@fukamachi
fukamachi / clhs.ros
Last active May 5, 2021 06:54
A Roswell script for opening HyperSpec page describing a given symbol in the default browser.
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
#|
A Roswell script to open the HyperSpec page of a specified symbol in the default browser.
@mrliptontea
mrliptontea / sublime-text-3-windows-shortcuts.md
Last active November 26, 2024 00:41 — forked from TheShrike/gist:6111200
Sublime Text 3 - Useful Shortcuts (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
$ ros starter.ros
While evaluating the form starting at line 127, column 0
of #P"/usr/local/share/common-lisp/source/roswell/init.lisp":
Unhandled SB-INT:C-STRING-DECODING-ERROR in thread #<SB-THREAD:THREAD
"main thread" RUNNING
{1002D77563}>:
:UTF-8 c-string decoding error:
the octet sequence #(200 23) cannot be decoded.
Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1002D77563}>
@fukamachi
fukamachi / Dockerfile
Created June 16, 2015 10:52
Dockerfile for building an image of Ubuntu with Roswell
FROM ubuntu
MAINTAINER Eitaro Fukamachi <[email protected]>
LABEL Description="Ubuntu with Roswell, Common Lisp implementation manager"
RUN apt-get update && apt-get install -y autotools-dev automake libcurl4-gnutls-dev curl make
RUN curl -SL https://github.com/snmsts/roswell/archive/release.tar.gz \
| tar -xzC /tmp/ \
&& cd /tmp/roswell-release \
&& sh bootstrap \
@DBarney
DBarney / 0overview.md
Last active May 3, 2020 17:35
Overview of Illumos Zone operation bottlenecks.

We constantly have around 1000 running zones and around 1000 stopped zones on a SmartOS machine. Having a lot of zones on the machine cause zone operations to take around 5 - 15 Minutes apeice. That it a huge amount of time. For example a few months ago we had a machine reboot and it took about 4 hours for all of the zones to transition to running.

4 hours. That sucked.

Before that we had been digging into speeding things up, but 4 hours made it a major priority.

These files are a short description of what we found and did to speed things up.

All frame graphs were generated using Brendan Gregg's FlageGraph.