Commit 2d915eda authored by Izaya's avatar Izaya

import the old stuff

parents
This diff is collapsed.
# site
This is stuff for generating my site, because I want it to be static rather than a huge amount of CGI scripts.
#!/bin/bash
./genfp.lua > src/index.md
./gennews.lua > src/news/index.md
./gensite.lua
./genrss.lua > out/rss.xml
#!/usr/bin/lua
lfs = require "lfs"
parsepage=require "parsepage"
cdir = lfs.currentdir()
local ftab = {}
local nftab= {}
local dpath="src/news"
local rpath="news"
local dirls = io.popen("ls "..cdir.."/"..dpath):read("*a")
local t = {}
local function helper(line) table.insert(t, line) return "" end
helper((dirls:gsub("(.-)\r?\n", helper)))
for k,v in ipairs(t) do
if v:sub(1,1) ~= "." and v:sub(-3) == ".md" and v ~= "index.md" then
table.insert(ftab,v)
end
end
local selten={}
if #ftab > 10 then
mcount = 9
else
mcount = #ftab-1
end
for i = #ftab,#ftab-mcount,-1 do
table.insert(selten,{ftab[i],i})
end
print("-- title ShadowKat Studios")
for k,v in ipairs(selten) do
fobj=io.open(cdir.."/"..dpath.."/"..v[1])
local c=fobj:read("*a")
fobj:close()
local page = parsepage(c)
print("####["..page.title.."]("..rpath.."/"..v[2]..".html)")
print(page.md:match("\n\n(.-)\n"))
end
print("###[News index]("..rpath.."/)")
#!/usr/bin/lua
lfs = require "lfs"
parsepage=require "parsepage"
cdir = lfs.currentdir()
local ftab = {}
local nftab= {}
local dpath="src/news"
local rpath="news"
local dirls = io.popen("ls "..cdir.."/"..dpath):read("*a")
local t = {}
local function helper(line) table.insert(t, line) return "" end
helper((dirls:gsub("(.-)\r?\n", helper)))
for k,v in ipairs(t) do
if v:sub(1,1) ~= "." and v:sub(-3) == ".md" and v~="index.md" then
table.insert(ftab,v)
end
end
local selten={}
if #ftab > 10 then
mcount = 9
else
mcount = #ftab-1
end
for i = #ftab,1,-1 do
table.insert(selten,{ftab[i],i})
end
print("-- title News - SKS")
for k,v in ipairs(selten) do
fobj=io.open(cdir.."/"..dpath.."/"..v[1])
local c=fobj:read("*a")
fobj:close()
local page = parsepage(c)
print("####["..page.title.."]("..v[2]..".html)")
print(page.md:match("\n\n(.-)\n"))
end
#!/usr/bin/lua
lfs = require "lfs"
parsepage=require "parsepage"
cdir = lfs.currentdir()
local ftab = {}
local nftab= {}
local dpath="src/news"
local rpath="news"
local title = "ShadowKat Studios"
local description = "Technology, code and such"
local mainsite = "https://testing.shadowkat.net/"
print([[
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>]]..title..[[</title>
<description>]]..description..[[</description>
<link>]]..mainsite..[[</link>]])
local dirls = io.popen("ls "..cdir.."/"..dpath):read("*a")
local t = {}
local function helper(line) table.insert(t, line) return "" end
helper((dirls:gsub("(.-)\r?\n", helper)))
for k,v in ipairs(t) do
if v:sub(1,1) ~= "." and v:sub(-3) == ".md" and v ~= "index.md" then
table.insert(ftab,v)
end
end
local selten={}
if #ftab > 10 then
mcount = 9
else
mcount = #ftab-1
end
for i = #ftab,#ftab-mcount,-1 do
table.insert(selten,{ftab[i],i})
end
for k,v in ipairs(selten) do
fobj=io.open(cdir.."/"..dpath.."/"..v[1])
local c=fobj:read("*a")
fobj:close()
local page = parsepage(c)
print([[ <item>
<title>]]..page.title..[[</title>
<link>]]..mainsite..rpath.."/"..v[2]..[[.html</link>
<description>]]..page.md:match("\n\n(.-)\n")..[[</description>
<pubDate>]]..page.date..[[</pubDate>]])
if page.author then
print(" <author>"..page.author.."</author>")
end
print(" </item>")
end
print([[</channel>
</rss>]])
#!/usr/bin/env lua
staticpath,srcpath,outpath,includepath = "static","src","out","include"
lfs = require "lfs"
parsepage = require "parsepage"
-- clean out/
print("Cleaning "..outpath.."...")
os.execute("rm -r "..outpath.."/*")
print("Copying "..staticpath.."/* to "..outpath.."/")
os.execute("cp -r "..staticpath.."/* "..outpath.."/")
-- scrape dirs
d,g={srcpath},{}
for k,v in ipairs(d) do
for f in lfs.dir(v) do
if f:sub(1,1) ~= "." then
if lfs.attributes(v.."/"..f).mode == "directory" then
print("Dir: "..v.."/"..f)
d[#d+1] = v.."/"..f
elseif lfs.attributes(v.."/"..f).mode == "file" and f:sub(-3) == ".md" then
print("Markdown file: "..v.."/"..f)
g[#g+1] = v.."/"..f
end
end
end
end
-- read headers and stuff
print("Reading headers, footers etc")
f=io.open(includepath.."/header.html")
if f then
header=f:read("*a")
f:close()
else
header = ""
end
f=io.open(includepath.."/footer.html")
if f then
footer=f:read("*a")
f:close()
else
footer=""
end
-- mkdir
print("Creating directories")
for k,v in ipairs(d) do
os.execute("mkdir -p "..outpath..v:sub(srcpath:len()+1))
end
-- generate stuff
print("Generating markdown pages:")
for k,v in ipairs(g) do
print(v)
f=io.open(v)
c=f:read("*a")
f:close()
page=parsepage(c)
np=v:sub(srcpath:len()+1):sub(1,-3).."html"
print(v,outpath.."/"..np,page.title,page.md)
f=io.open(outpath.."/"..np,"wb")
f:write("<html><head><title>"..(page.title or "").."</title>\n")
f:write(header)
f:write(page.html)
if page.author and page.date then
--f:write('<h3><div class="wrapper"><div class="left-column">By '..(page.author or "")..'</div><div class="right-column">'..(page.date or "")..'</div></div></h3>\n')
f:write('<h4>By '..(page.author or "")..' @ '..(page.date or "")..'</h4>\n')
end
f:write(footer)
f:close()
end
</div>
</body></html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<link rel="stylesheet" type="text/css" href="/css/solarized.css">
<link rel="stylesheet" type="text/css" href="/css/columns.css">
<link rel="stylesheet" type="text/css" href="/css/fonts.css">
<link rel="stylesheet" type="text/css" href="/css/header.css">
<link rel="stylesheet" type="text/css" href="/css/main.css">
<link rel="shortcut icon" href="/sks-ico.png" />
</head>
<body>
<h2 class="container header-container">
<div id="pixel" class="header-item" style="font-size: 125%;"><b><a href="/">ShadowKat Studios</a></b></div>
<div class="header-item"><a href="/projects">Projects</a></div>
<div class="header-item"><a href="/about">About</a></div>
<div class="header-item header-searchbox">
<iframe src="https://duckduckgo.com/search.html?site=shadowkat.net&prefill=Search" style="width:100%;height:40px;" frameborder="0"></iframe>
</div>
</h2>
<div id="wrapper">
function parsepage(s)
local page={}
page.md = ""
for l in s:gmatch("(.-)\n") do
if l:sub(1,3) == "-- " then
k,v=l:match("%-%- (.-) (.+)")
page[k] = v
else
page.md=page.md..l.."\n"
end
end
local fn="/tmp/md"..tostring(math.random(1,2^24))
f=io.open(fn,"wb")
f:write(page.md)
f:close()
page.html = io.popen("markdown "..fn):read("*a")
-- SKS specific stuff starts here
page.html=page.html:gsub("++leftcol",'<div class="left-column">')
page.html=page.html:gsub("++colbreak",'</div><div class="left-column">')
page.html=page.html:gsub("++colend",'</div>')
-- and ends here
return page
end
return parsepage
### About Me
Hi. I'm Izaya, or Shadow, depending on the day. I'm a networking geek with minimal actual qualifications and a probably-dangerous amount of curiosity.
#### Stuff I like
- Caffeine
- Clean code
- Anime
- A command line
- Open-source software
- Lisp (the programming language)
- Lua (the scripting language)
- Sci-Fi and Fantasy
- Computer games
- Non-x86 machine code
- UNIX-ish stuff
- Computer networks
- Haiku (the OS)
- Old computer hardware & software
#### Stuff I dislike
- IDEs. I hate IDEs especially
- Windows
- Heavy GUIs
- That abomination they call Active Directory
- AMD video cards
- GOTO
### Stuff I've done
- Set up a home lab
- Done some light Windows sysadmin work
- Set up this site and a bunch of other stuff
- Written an [IRC bot in Lua](https://github.com/XeonSquared/yukichan)
### Stuff I'm doing
- Writing an [OS for the minecraft mod OpenComputers](/projects/multice)
- Working on a [piece of fiction](//psyche.shadowkat.net)
### Stuff I do
- Run an IRC network node
- Waste lots of time on IRC
- Help out users on occasion
### Contact
Stuff on my shadowkat.net domain:
XMPP: izaya
#### On IRC:
- EsperNet - Izaya
- PC-Logix - Izaya
- Freenode - XeonSquared
- Quakenet - XeonSquared
-- title ShadowKat Studios
####[Customizing Windows installers](news/9.html)
I felt a need to make a custom installer image of Windows 7 for my desktop. This means including the Intel USB 3 and Pro 1000 ethernet controllers. I had a lot of uh... fun... doing so.
####[More site updates](news/8.html)
So I finally got fed up (during a meeting) and decided to rewrite my site to be entirely static except stuff that actually needs to be a CGI script, so that's what I'm doing as I write this.
####[Sanely building Cyanogenmod 13](news/7.html)
Part 2 of why you should never try to do any form of Android development ever.
####[Remotely building Cyanogenmod 13](news/6.html)
Part 1 of why you should never try to do any form of Android development ever.
####[Making Windows Sane to use](news/5.html)
Whether you have to use Windows for work, or are still running Windows for games, if you have any form of income and work in IT you probably have to use Windows. Windows is generally known as a Bad Thing, but it's often not an individual's choice. As such, I present to you, a guide to making Windows **Sane**
####[An advertising company for the advertising age](news/4.html)
I got bored a while ago, and came up with an idea to capitalize on people's brand-centricness.
####[Blog updates](news/3.html)
So I rewrote the backend for the whole site, including this blog page.
####[Adventures in btrfs](news/2.html)
btrfs is quite possibly the greatest filesystem ever. Okay, I can't really say that because I haven't tried zfs yet (one day...), but it has some really cool features.
####[Balance, and "if it works for you"](news/1.html)
This is probably going to be a rant, so you may want to continue scrolling.
###[News index](news/)
-- title Balance, and "if it works for you"
-- author Izaya
-- date Some time in 2016
#### Balance, and "if it works for you"
This is probably going to be a rant, so you may want to continue scrolling.
Balance is important. It's important for deciding what you eat, it's important when designing things, it's important when building games, when playing games, and it's also important when building computers. It has to have balanced specs, you need a balance between performance and price... Off-the-shelf boxes are usually unbalanced, and boxen for specific purposes are unbalanced for a reason. Other times, a computer seems under-powered, or even simply is under-powered, due to the price/performance balance. Now, I'm sorta annoyed about all of this at the moment, and my main point relates to this.
Intel processors tend to have better instruction-per-cycle counts compared to AMD processors. AMDs tend to have more cores and are often clocked higher.
I have a number of friends with AMD boxen. Those boxen do what their users need - mostly gaming, which is somewhere AMD processors are quite solid. These boxen usually have good graphics and a reasonable amount of RAM.
I, on the other hand, have an Intel processor. i3 4160, and it does what I need, though I'm looking at upgrading to a Xeon after I get a new phone. The reason for this is that I need more IPC and less single-core performance. The Xeon has an even lower clock speed than my current i3, but it has more cores and more cache, despite not costing a huge amount. I do a lot of virtualization, and I like to run a lot of programs at once. In contrast to this, my video hardware is midrange, a 750Ti. I don't do much gaming, so this doesn't bother me.
Now, this is all well and good, but what am I even ranting about?
Well, as it turns out, some people refuse to understand the whole "if it works for you" thing - anything that isn't as good as their box isn't good enough. These people also have a tendancy to be wealthy and have rather powerful machines. As such, I've heard a lot of "AMD sucks" - and while yes, AMD stuff does have a lower IPC, for the price, it's often better value than Intel processors.
If it does what the user needs, there's nothing wrong with the choice. Some people choose to be... unsavoury and ignore that.
It just annoys me. Not like I can do anything about it, but it annoys me.
This effect in action: Plenty of people I know use AMD graphics cards, while I choose not to because NVIDIA cards have better Linux support. As Windows users, this does not bother those people.
That is all.
-- title Adventures in btrfs
-- author Izaya
-- date Some time in 2016
#### Adventures in btrfs
btrfs is quite possibly the greatest filesystem ever. Okay, I can't really say that because I haven't tried zfs yet (one day...), but it has some really cool features.
So, in the time I had off I reinstalled my laptop to be even more paranoid, the details I will not get into. However, I will say that I installed Arch, Debian and a copy of Windows 7. Let me tell you, partitioning and not breaking Windows is a real pain. Did you know Windows doesn't like it if you overwrite the System Reserved partition?
Anyway, the Windows is boring. Some of the interesting things I did are:
- I set a BIOS password required to boot the machine, and my laptop has the password stored in EEPROM instead of a battery-backed SRAM chip, so taking out the CMOS battery won't remove it
- I set up an encrypted /boot partition, which is fun because I can have passwords on GRUB and they are effectively un-bypassable, and you can't see the entries for other users without decrypting it.
- I did some fun stuff with btrfs, for example, installing two distros in the same filesystem, while having one bootable as an LXC container on the other using a considerable amount of dark magic.
How does that work?
Well, btrfs has a cool system of subvolumes, which can be mounted independantly of each other. So, I have the debian system as the root of the filesystem, and /var/lib/lxc/arch/rootfs as a subvolume containing a bootable arch system.
I also did the same thing with /boot - except Arch is the one in control here, mainly because it's easier to do fun stuff with the bootloader on Arch. The /boot partition also has subvolumes - one named debian at present, as I can use that to load the debian kernel and initramfs without doing weirder stuff with other filesystems.
So, depending on the OS running at the time, you have two possible FS layouts:
- On Arch:
- / is /dev/mapper/cryptroot -o compress=zlib,subvol=var/lib/lxc/arch/rootfs,defaults
- /boot/ is /dev/mapper/cryptboot -o compress=zlib,defaults
- On Debian:
- / is /dev/mapper/cryptroot -o compress=zlib,defaults
- /boot/ is /dev/mapper/cryptboot -o compress=zlib,subvol=debian,defaults
So this is how I have two distros on the same filesystem. You can also run Arch as an LXC container from Debian, 'cause why not?
My next experiment will be installing NixOS on the same filesystem, we'll see how well that works.
-- title Blog updates
-- author Izaya
-- date Some time in 2016
#### Blog updates
So I rewrote the backend for the whole site, including this blog page.
Major changes include:
- Runs on webservers other than apache2 (runs as CGI script)
- Cleaner HTML and CSS
- The Lua behind it all sucks less
-- title An advertising company for the advertising age
-- author Izaya
-- date Some time in 2016
#### An advertising company for the advertising age
I got bored a while ago, and came up with an idea to capitalize on people's brand-centricness.
##### Step 1: Build an advertising business
Or take over one. Google's advertising business would be a good start.
##### Step 2: Have a premium option for users.
Walk out onto the street for a moment. Or don't because you don't want to, that's fine too. The reason I wanted you to do this is simple: What does your typical normal person look like?
Now, I work somewhere that is... not cheap, shall we say. This is most unfortunate as many of the people are not my idea of a good person but there's not much I can do about that. Anyway, here's an example from my observations:
- Converse shoes
- Skinny jeans
- Branded T-shirt
- Vans bag (the brand)
- Adidas jacket
Now, I'm assuming these people have payed for these items. They might have been given them or something, but for the purposes of this article, they bought them.
Paying for branded clothing is paying several times the normal price for a cheap item with advertising on the front, back or side. Put simply, *people pay extra to display advertising on themselves*.
The idea behind the 'premium option' for users is this: their ads will be replaced with a brand logo, slogan or other advertising material of their choice. I'm not sure why people would do that rather than using some form of adblock but people pay extra for advertising so why not?
You're probably thinking "but advertisers wouldn't want their ads blocked by the service". Right you are. However, the solution to that is to give the advertisers a part of the profit from the Premium subscription. This way, they get some return even if nobody buys their product. Web 'developers' putting advertising on their site would also get a cut of the profit, as to be expected.
##### Step 3: ???
##### Step 4: Profit!
-- title Making Windows Sane to use
-- author Izaya
-- date Some time in 2016
#### Making Windows **Sane** to use
Whether you have to use Windows for work, or are still running Windows for games, if you have any form of income and work in IT you probably have to use Windows. Windows is generally known as a Bad Thing, but it's often not an individual's choice. As such, I present to you, a guide to making Windows **Sane**
##### My environment
I did this on my main home desktop:
- i3 4160
- 8GB RAM
- GTX750Ti
- 500GB Windows HDD
It runs Windows 7 and for this guide I used a copy of VMWare Workstation.
##### 1. Materials
- Windows
- Linux installer(s) (I used Debian and Arch)
- [VcXsrv](https://sourceforge.net/projects/vcxsrv/)) (you could use Xming but VcXsrv is a lot better, for example supporting borderless windows)
- [PuTTY](http://www.putty.org/) and pageant, or your favorite fork
- Virtualisation Software - [VirtualBox](https://www.virtualbox.org/) works fine
##### 2. Setup
First, install your hypervisor. You'll want to get your linux virtual machine(s) installing. The rest of this can be done while you wait.
Get VcXsrv and PuTTY installed. Generate your keys. Ideally get pageant running at login (by placing a shortcut in the Startup directory of your start menu).
If you have a box to test X11 forwarding on, do so now.
Once your virtual machine(s) are done with the base install, you'll want to install:
- most of the xorg set (xauth is important)
- the ssh daemon
- XFCE (you could use other DE/utils but I haven't tried them) (also look into the XFCE whisker menu, it's much nicer than the standard menu)
- lxappearance (for theme changing)
- any applications you want to run in on Linux, for example LibreOffice which somehow performs better over X11 forwarding to a VM than on real Windows.
At this point it would probably be wise to reboot both the virtual machine and the host machine, because knowing Windows it might even prevent future errors.
Also look into getting the virtual machine(s) running at boot so you don't have to manually start them
##### 3. Usage
Determine the IP address of your virtual machine(s). Create a session for each. Under Connection/SSH, put xfce4-panel in the Remote Command box. Enable X11 forwarding under Connection/SSH/X11.
Unless you already put your key in it'll ask you for your password when you log in. After you enter it, there'll be some GTK warnings but it's fine. The panel should ask you about initial setup. Don't use the default, just make a single panel somewhere out of the way, make it autohide, and stick some launchers.
For some *odd reason*, Windows doesn't provide EWMH so you can't use the window buttons/menu but just about all of the other panel widgets should work.
##### 4. Enjoy a semi-sane environment
Some possible things you may want to look into:
- setting up samba on the VM so you can mount a file in your home dir to your Windows
- setting up a web server/ssh server that is forwarded from the host to a VM
- making custom live CDs so you can have disposable virtual machines
- playing with other window managers/desktop environments
-- title Remotely building Cyanogenmod 13
-- author Izaya
-- date Late 2016
#### Remotely building Cyanogenmod 13
Part 1 of why you should never try to do any form of Android development ever.
I'm away from home at the moment, with only my laptop (A Lenovo IdeaPad S10e). I've been wanting to upgrade my phone from Cyanogenmod 12 for a while, however the only nightlies availible from the cyanogenmod site are Cyanogenmod 14, which seems a little more buggy than I'd like. This seemed like a perfect time to figure out how to build Cyanogenmod, so I can learn how to enable the features I need to run LXC on Android as well.
So, obviously, the first plan was to build it on my laptop. That wasn't going to work.
##### My laptop
- 32-bit processor
- 2GB RAM
- 80GB disk space
##### Requirements
- 64-bit processor
- 8GB RAM
- 100GB disk space
Right, so that won't work. Fortunately, at home I have a nice, powerful server I can spin up a VM on. The CM wiki recommends using Ubuntu but I prefer Debian, so I throw up a Debian VM with two cores (of a Xeon 1231v3), 8GB of RAM and 200GB of disk space.
I follow the guides on the wiki on setting up a build environment and such, and it takes a few hours to download the 20GB of source files. Plenty of time for a dip in the pool and such.
I run into somewhat of a problem at the "Extract proprietary blobs" section. The scripts assume adb on the machine you're building on can talk to your device. To recap, the machine I'm building CM on is 300km or so away and my phone is sitting on the table next to me. What does our hero do now?
Okay, thing 1: in the Developer Options section of Settings on my phone, I can enable 'ADB over network'. This lets me connect to ADB over the network, as you may have guessed. It uses TCP. Okay, great, now I no longer need the cable to copy files to/from my phone.
Thing 2: ssh can do remote port forwarding, so I can forward a port my laptop can access to a port on a remote machine. This means that I can forward the port adb over network uses to my virtual machine 300km away.
```
[izaya@sks-s10e-1 ~]$ ssh -R *:5555:192.168.0.102:5555 cmbuild
```
So this is where I'm at now: waiting for my files to upload from my phone over 3G.
I'll update this soon.
-- title Sanely building Cyanogenmod 13
-- author Izaya
-- date Late 2016
#### Sanely building Cyanogenmod 13
Part 2 of why you should never try to do any form of Android development ever.
So, take two. I gave up on the Debian virtual machine ... yesterday. Yeah, it was yesterday. I feel like [that xkcd strip](https://xkcd.com/456/) is rather relevant, the last 36 hours or so have been a blur of mexican takeout, cola and compiler errors.
So, a few things I did:
- Dropped Debian in favor of Arch
- Found out that old Arch and new QXL don't get along
- Dealt with cert issues on the Cyanogenmod maven repo
- Managed to allocate 7GB RAM less than intended to a virtual machine
##### Arch and QXL
The Arch Linux iso I keep around is from 2016-09-03 because I'm too lazy to download a new one. After recent upgrades to the virtualization server, I updated all the stuff on the system as well, which updated qemu and libvert and such. Now, fun fact: on occasion Arch will hang when exposed to a version of the QXL video driver it doesn't understand, with common timing being **while you're trying to install Arch**, which is positively *wonderful*.
As much fun as that was, I've had the same issue with Haiku, so I just set it to VGA and got on with my day.
##### Cert issues
So, after waiting about 5 hours for the cyanogenmod source to download AGAIN, I got to work trying to compile it - grab the binary blobs from the [proprietary-vendor-motorola repo](https://github.com/TheMuppets/proprietary_vendor_motorola), breakfast osprey, make -j8...
After about 15 minutes it [tells me it failed](http://pb.i0i0.me/p/xbFzukk6). Apparently this is a known issue, caused by certificate issues on the Cyanogenmod maven repo. Okay, great. In the #cyanogenmod-dev topic on Freenode it has a [link to a workaround](https://review.cyanogenmod.org/#/c/174025/). Righto, should be easy to just apply this patch, right?
Wrong. `repopick -f 174025` couldn't figure out where it was meant to put the files. Apparently it should work if you're in ~/android/system, but it sure as hell didn't. At least the solution was simple.
```
wget https://maven.cyanogenmod.org/artifactory/gello_prebuilds/org/cyanogenmod/gello/40/gello-40.apk --no-check-certificate
```
##### Memory fun.
About 20 minutes into another build, I opened htop to check usage, mainly because I was bored. I was under the impression I'd given that virtual machine 4 threads and 8GB of RAM.
I had not.
It had 4 threads and 1GB of RAM.
Among other things, this caused several builds to crash.
I am not a clever man.
##### Success!
First compile worked! Now time to customize it (and use ccache).
#### make completed successfully (01:09:10 (hh:mm:ss)) ####
-- title More site updates
-- author Izaya
-- date 2017/07/03 15:32 +1000
#### More site updates
So I finally got fed up (during a meeting) and decided to rewrite my site to be entirely static except stuff that actually needs to be a CGI script, so that's what I'm doing as I write this.
Oh, also, it's all available [here](https://git.theender.net/izaya/site).
-- title Customizing Windows installers
-- author Izaya
-- date 2017/07/07 18:18 +1000
#### Customizing Windows installers
I felt a need to make a custom installer image of Windows 7 for my desktop. This means including the Intel USB 3 and Pro 1000 ethernet controllers. I had a lot of uh... fun... doing so.
Seems simple enough, right? Mount the iso image, add some files, burn to a DVD? Wrong. While you do need to mount or extract the ISO, you also need to:
- mount a wim image
- extract your drivers
- add your drivers to the image using dism
- unmount the wim image
- make a new ISO
- burn new ISO to the DVD
That isn't really that much, when you think about it... Provided all the tools work correctly. So I looked up a guide on how to do it, because I'm a linux guy normally, and I found [this guide on superuser](https://superuser.com/a/63774). It looked sane enough, so I installed the Windows Automated Installation Kit and went to go through the tools:
```
C:\Windows\System32> cd C:\Users\izaya\Documents\Windows-7-Universal-x64\sources
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> imagex /mountrw install.wim 3 c:\wim
'imagex' is not recognized as an internal or external command, operable program or batch file.
```
Yeah. The tool wasn't installed with the WAIK. So, as a guess, I tried to run it from system32 (because every Windows utility is installed in system32 because what's $PATH?)
```
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> C:\Windows\system32\imagex.exe
'C:\Windows\System32\imagex.exe' is not recognized as an internal or external command, operable program or batch file.
```
Yup. Not installed.
So I looked it up to find that ImageX had been discontinued in favor of dism.exe.
So I look up the docs for dism and found the syntax:
```
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> dism /mount-wim /wimfile:install.wim /index:3 /mountdir:C:\wim
Deployment Image Servicing and Management tool
Version 6.1.7600.16385
Error: 87
The mount-wim option is unknown.
For more information, refer to the help.
```
... Okay, maybe the dism documentation only applies for Windows 10? I'll check the docs in the WAIK installer...
```
Dism /Mount-Wim /WimFile:C:\test\images\MyImage.wim /index:1 /MountDir:C:\test\offline
```
That's fine. The dism tool is just wrong. I'll reinstall the WAIK.
Nope. So I rebooted. `dism /mount-wim` worked. Great. Just needed a reboot. Return to the right dir rather than system32...
```
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> dism /mount-wim /wimfile:install.wim /index:3 /mountdir:C:\wim
Deployment Image Servicing and Management tool
Version 6.1.7600.16385
Error: 87
The mount-wim option is unknown.
For more information, refer to the help.
```
Suffice to say that I screwed around for a while until I realised the difference is that one was run from . in system32, so specifying `C:\Windows\System32\dism.exe` made it work normally.
Now I understand why people complain about the Windows PATH variable being stupid.
-- title News - SKS
####[Customizing Windows installers](9.html)
I felt a need to make a custom installer image of Windows 7 for my desktop. This means including the Intel USB 3 and Pro 1000 ethernet controllers. I had a lot of uh... fun... doing so.
####[More site updates](8.html)
So I finally got fed up (during a meeting) and decided to rewrite my site to be entirely static except stuff that actually needs to be a CGI script, so that's what I'm doing as I write this.
####[Sanely building Cyanogenmod 13](7.html)
Part 2 of why you should never try to do any form of Android development ever.
####[Remotely building Cyanogenmod 13](6.html)
Part 1 of why you should never try to do any form of Android development ever.
####[Making Windows Sane to use](5.html)
Whether you have to use Windows for work, or are still running Windows for games, if you have any form of income and work in IT you probably have to use Windows. Windows is generally known as a Bad Thing, but it's often not an individual's choice. As such, I present to you, a guide to making Windows **Sane**
####[An advertising company for the advertising age](4.html)
I got bored a while ago, and came up with an idea to capitalize on people's brand-centricness.
####[Blog updates](3.html)
So I rewrote the backend for the whole site, including this blog page.
####[Adventures in btrfs](2.html)
btrfs is quite possibly the greatest filesystem ever. Okay, I can't really say that because I haven't tried zfs yet (one day...), but it has some really cool features.
####[Balance, and "if it works for you"](1.html)
This is probably going to be a rant, so you may want to continue scrolling.
-- title Projects
++leftcol
### Technology
#### [MultICE](/projects/multice)
A simple, small kernel suitable for embedded usage
#### [Test3D](https://github.com/XeonSquared/test3d)
A Minetest mod adding low-tech computing.
#### [yukichan](https://github.com/XeonSquared/yukichan)
An IRC bot written in Lua
++colbreak
### Other
#### [Psyche](https://psyche.shadowkat.net)
Work-in-progress work of fiction.
++colend
### MultICE - the MultIplexed Computing Environment
MultICE is a cooperative multitasking operating system for the Minecraft mod OpenComputers. It is designed for embedded systems running from ROM, though it can be used on larger, more powerful systems as well.
#### Features
- Cooperative multitasking
- Networking stack (in progress)
- Tiny footprint
- Ability to customise the system for your needs
- Simple and effective build system
- Simple terminal emulator (implements newlines, carriage returns and form feeds, with scrolling and input)
### Download
Development occurs in the [Github repository](https://github.com/XeonSquared/multice).
#### Self-extracting archives:
- [master](sea/multice.sea.lua) ([history](build/))
- [dev](sea-dev/multice.sea.lua) ([history](build-dev/))
#### System requirements:
- T1 CPU
- T1 RAM
- EEPROM or R/W storage with at least 500 bytes free space
#### Build requirements:
- Linux or OpenOS (Self-hosting build system planned. DOS- and NT-based operating systems may work but are untested.)
- Lua 5.2 or newer (5.1 untested, probably fine)
- At least 64KB of disk space to fit the modules
.centre-column {
width: 90%;
text-align: left;
}
.centre-column, .wrapper {
margin: 0px auto;
overflow: hidden;
}
@media screen and (min-width: 801px) {
.left-column, .right-column {
width: 49%;
text-align: left;
padding-bottom: 32767;
margin-bottom: -32767px;
}
.left-column {