Skip to content

Instantly share code, notes, and snippets.

View robinsmidsrod's full-sized avatar

Robin Smidsrød robinsmidsrod

View GitHub Profile
@robinsmidsrod
robinsmidsrod / etc_clamav_clamd.conf
Last active December 27, 2015 20:49
Postfix/DSPAM/ClamAV/Dovecot with MySQL mail server setup (all encrypted with SSL/TLS)
#Automatically Generated by clamav-base postinst
#To reconfigure clamd run #dpkg-reconfigure clamav-base
#Please read /usr/share/doc/clamav-base/README.Debian.gz for details
TCPSocket 3310
TCPAddr 127.0.0.1
# TemporaryDirectory is not set to its default /tmp here to make overriding
# the default with environment variables TMPDIR/TMP/TEMP possible
User clamav
AllowSupplementaryGroups true
ScanMail true
@robinsmidsrod
robinsmidsrod / gist:6175108
Last active December 20, 2015 18:19
Dynamically loading PCI information with iPXE scripting
#!ipxe
set spaces:hex 20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20
clear addr
:load pciscan addr || goto load_done
set vendor ${pci/${addr}.0.2}
set device ${pci/${addr}.2.2}
chain -a pci/${vendor}.ipxe ||
chain -a pci/${vendor}/${device}.ipxe ||
@robinsmidsrod
robinsmidsrod / firefly.ipxe
Created June 14, 2013 13:02
Firefly IllumOS recovery environment netbooted using iPXE
#!ipxe
echo Booting Firefly 0613 for ${initiator-iqn}
set base-url ${boot-url}/firefly-0613/boot
# http://alexeremin.blogspot.no/2013/05/firefly-failsafe-image-for-illumos.html
# http://sourceforge.net/projects/fireflyfailsafe/files/
# Download ISO, unpack ISO and copy files to boot-url
# The ramdisk is compressed with gzip, which must be unpacked
# to work with iPXE
# mv firefly firefly.gz
# gunzip firefly.gz
@willurd
willurd / web-servers.md
Last active May 7, 2024 04:58
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@robinsmidsrod
robinsmidsrod / gist:5691673
Last active December 17, 2015 23:49
Workaround patch to iPXE for gcc 4.8 - allows you to compile, but is not an optimal solution
diff --git a/src/arch/i386/interface/pxe/pxe_call.c b/src/arch/i386/interface/pxe/pxe_call.c
index 7fce75a..2ad3e77 100644
--- a/src/arch/i386/interface/pxe/pxe_call.c
+++ b/src/arch/i386/interface/pxe/pxe_call.c
@@ -271,12 +271,14 @@ int pxe_start_nbp ( void ) {
DBG ( "Restarting NBP (%x)\n", jmp );
/* Far call to PXE NBP */
- __asm__ __volatile__ ( REAL_CODE ( "movw %%cx, %%es\n\t"
+ __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t"
@robinsmidsrod
robinsmidsrod / gist:5657647
Created May 27, 2013 15:28
List unused ZFS disks in a Solaris-based OS
comm -3 <(comm -3 <(iostat -en | tail -n +3 | perl -lane 'print $F[-1]'|sort) <(zpool list | tail -n +2 | perl -lane 'print $F[0]'|sort)) <(zpool list -v | egrep '^\s{4}' | perl -lane '$F[0] =~ s/s0$//; print $F[0]' | sort)
@robinsmidsrod
robinsmidsrod / gist:5652708
Last active December 17, 2015 18:19
Migrating from Nexenta NCP to OmniOS - post install / zpool import modifications
SMB passwords working
- add in /etc/pam.conf: other password required pam_smb_passwd.so.1 nowarn
- http://web.archive.org/web/20110907145354/http://wiki.genunix.org/wiki/index.php/Getting_Started_With_the_Solaris_CIFS_Service
- passwd username (for all SMB users)
- smbadm join -w MYWORKGROUP
- smbadm enable-user myadmin
- smbadm add-member -m myadmin administrator
syslog to central server
- add this line to /etc/syslog.conf (use TAB as delimiter) and svcadm restart system-log:
@john-clark
john-clark / SET-WDS-PXE.CMD
Last active September 15, 2022 15:40
windows deployment server
@ECHO OFF
ECHO Before using this make sure all file types are allowed
ECHO Use clear-tftfpfilter.reg @ https://gist.github.com/john-clark/5360694/
:: Command line error check:
IF "%1"=="" GOTO Syntax
:: Check default
IF "%1"=="default" GOTO ResetWDS
@john-clark
john-clark / i.pxe
Last active February 27, 2023 21:46
ipxe php boot system
#!ipxe
#
# This file gets compiled into undionly.kpxe
################################################################
:vars
set next-server 192.168.2.121
cpuid --ext 29 && set arch amd64 || set arch x86
:netconfig
dhcp net0 || goto ipxeshell
:prompt
@robinsmidsrod
robinsmidsrod / iPXE.xml
Last active December 15, 2015 12:39
iPXE script syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="iPXE" ext="ipxe" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="1" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00# 01 02((EOL)) 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2">0x</Keywords>