Permalink
Browse files

Updated posts/pages to use GFM fenced code blocks.

  • Loading branch information...
Silvenga committed Dec 16, 2017
1 parent fb83c0e commit eb92f78810608606e50c0a4b1582f3e322805457
View
@@ -37,7 +37,7 @@ To claim this, I am signing this object:
with the aforementioned key, yielding the PGP signature:
```
```gpg
-----BEGIN PGP MESSAGE-----
yML7AnicbZF7TBRnF8Z3WUCgCktruTS2yBBdUle+uV/WUirtokRjagVjrX4wO/Pu
@@ -10,22 +10,22 @@ I needed a better backing storage system for my Kubernetes cluster - I am done w
So I got a Luminous Ceph cluster deployed and everything was working (after fighting with the beta external storage features, no more custom Kube Controllers, yay!). Then I tried to actually get a test deployment up, but I kept on seeing the following errors on my nodes:
```
```log
libceph: mon0 172.16.0.104:6789 feature set mismatch, my 106b84a842a42 < server's 40106b84a842a42, missing 400000000000000
```
I originally thought it was due to running Luminous (the ceph provisioner that I was using targeted Jewel) so I created my own image with Luminous binaries. Same message as before, no change from what I could tell. My next idea was the image format was to new (stupid thought in retrospective, *shrug*). No change on that error message.
Looking deeper into the error message (which I should have done before). This error occurred from a monitor after image construction, but before image mount. The error was complaining that the feature flag `400000000000000` was missing support by my client. This feature turns out to mean basically `CRUSH_TUNABLES5` with the following requirements (Google is great at this):
```
```log
v10.0.2 (jewel) or later
Linux kernel version v4.5 or later (for the file system and RBD kernel clients)
```
And that's my problem. I'm assuming that Kubernetes is using the kernel module to mount rbd's, but my nodes are running Ubuntu 16.04 with the following kernel:
```
```log
4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
```
@@ -37,7 +37,7 @@ This leaves me with 3 options to fix this:
Turns out the last one is really easy to do, Ceph really is enterprise ready. Running the following on a node finally got my image to mount within a pod.
```
```bash
ceph osd crush tunables hammer
```
@@ -6,13 +6,13 @@ Description: How to convert a Windows Server 2016 trial installation to full ret
Using your retail key with the ISO's downloaded from Microsoft's "Evaluation Center" should be easy right? You paid for a license so you should be able to just activate a trial... Turns out it's not that simple. You actually need to change your server edition from ServerBlahEvalEdition to whatever edition you have a key for using `dism`.
```
```bat
DISM /Online /Set-Edition:ServerDatacenter /ProductKey:<key for blah>
```
This command is going to yell at you for not accepting the EULA, so the final command looks like this:
```
```bat
DISM /Online /Set-Edition:ServerDatacenter /ProductKey:<key for blah> /AcceptEula
```
@@ -29,7 +29,7 @@ The command takes a good 10 minutes to run (looks like it stalls), then asks to
For extra credit, you can activate VM's running on a Datacenter host by using AVMA keys (Automatic Virtual Machine Activation). The commands would look like this:
```
```bat
DISM /Online /Set-Edition:ServerDatacenterCor /AcceptEula /ProductKey:TMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
DISM /Online /Set-Edition:ServerStandardCor /AcceptEula /ProductKey:C3RCX-M6NRP-6CXC9-TW2F2-4RHYD
```
@@ -29,7 +29,7 @@ If you can't find the correct packages from Ubuntu's Repo's checkout Debain's. M
```
```bash
# I like a clean workspace
cd /tmp
@@ -56,7 +56,7 @@ First we need a "network name", this name separates nodes, and allows for multip
First we need to create a "network" configuration directory. For Tinc this is done by creating a folder in `/etc/tinc/`.
```
```bash
cd /etc/tinc
sudo mkdir master
sudo mkdir master/hosts
@@ -90,14 +90,14 @@ ConnectTo = mccain
This one is for Obama, make sure to `name` the other server differently (Mccain).
#### tinc-up
```
```bash
#!/bin/sh
ifconfig $INTERFACE 10.6.0.1 netmask 255.255.0.0
```
Obama will have `10.6.0.1` as its address. Setup Mccain to something different (`10.6.0.2` would work). Make sure to include `#!/bin/sh`, else Tinc might have issues.
#### tinc-down
```
```bash
#!/bin/sh
ifconfig $INTERFACE down
```
@@ -106,7 +106,7 @@ Although not strictly required, this allows us to clean up after we shut down Ti
We need to allow Tinc to execute these last two files.
```
```bash
sudo chmod +x tinc-*
```
Now we need to make host files. These files point Tinc to each other, and allows direct connections. These files are safe and required to share around.
@@ -130,22 +130,22 @@ After generating keys, make sure to share the updated host file for the local no
## Running Tinc
After we share the host files around we can start Tinc.
```
```bash
sudo tincd -n master
```
`-n <network name>` is used to specify a particular (you can multiple networks on the same server).
To kill Tinc use `-k`.
```
```bash
sudo tincd -n master -k
```
If there are no issues we can set Tinc to run on startup (and to obey the service commands).
Simple command:
```
```bash
sudo echo "master" >> nets.boot
```
@@ -10,7 +10,7 @@ Description: Some notes on how to setup OpenVPN obfuscation using Obfproxy.
## Server (Ubuntu 14.04 LTS)
`obfsproxy` is included in the default Ubuntu Trusty repos now (although a bit out of date). It contains the pluggable transport `obfs3`.
```
```bash
apt-get install obfsproxy
# Default OVPN port: 1194
@@ -32,7 +32,7 @@ Signature via "Mark Lopez (Authority) 4096R/FEF78709"
https://store.silvenga.com/external/obfsproxy/obfsproxy-win-4.0.3.zip.asc
https://store.silvenga.com/external/obfsproxy/obfsproxy-win-5.0.2.zip.asc
```
```bash
# Connect via socksv5 127.0.0.1:2194
# with host server:8443
@@ -31,7 +31,7 @@ Our server will act as a relay point (although you can relay to localhost if you
Let's first install sTunnel through `apt-get`.
```
```bash
sudo apt-get update # always a good idea
sudo apt-get upgrade # let's start fresh
sudo apt-get install stunnel4 # 4 is the newest version as of 4/2014
@@ -41,7 +41,7 @@ sudo apt-get install stunnel4 # 4 is the newest version as of 4/2014
We are using a HTTPS tunnel so let's generate some HTTPS certificates (self signed).
```
```bash
# let's work in our tmp directory
cd /tmp/
@@ -58,7 +58,7 @@ You should get something like this:
> *You can answer `.` (period) to all the questions except the `Common Name` which should be your hostname, public IP address, or DNS name of the server.*
```
```bash
# openssl req -new -x509 -key stunnel.key -out stunnel.crt -days 1826
You are about to be asked to enter information that will be incorporated
into your certificate request.
@@ -78,20 +78,20 @@ Email Address []:.
We now have both the certificate and its key. For convenience let's combine the two files into one.
```
```bash
# Concatenate the key and the certificate into the file /etc/stunnel/stunnel.pem
cat stunnel.key stunnel.crt > /etc/stunnel/stunnel.pem
```
Cool, our certificate is ready. Clean up our current directory.
```
```bash
rm stunnel.crt stunnel.key
```
Move to our sTunnel configuration directory and create a configuration file.
```
```bash
cd /etc/stunnel/ # Default on Ubuntu
touch stunnel.conf # We like touching files :P
nano stunnel.conf # Or your favorite editor
@@ -122,7 +122,7 @@ connect = us-florida.privateinternetaccess.com:443
Enable and start sTunnel.
```
```bash
nano /etc/default/stunnel4
# Change ENABLED=0 to ENABLED=1
@@ -143,7 +143,6 @@ Install the software with default options.
Start the software (search for `stunnel gui`) and edit the configuration with `Configuration > Edit Configuration`. Copy and paste the following to the end of the file. Make sure to edit `remote-server.example.com` to be your server address.
```
[openvpn-localhost]
# Set sTunnel to be in client mode (defaults to server)
@@ -157,7 +156,6 @@ connect = remote-server.example.com:8443
client = yes
accept = 127.0.0.1:1198
connect = remote-server.example.com:1198
```
Reload the configuration by `Configuration > Reload Configuration`.
@@ -7,29 +7,29 @@ A cheat sheet of all the cool things that knowing PowerShell can help with when
> Copy packages from one project to another.
```
```ps1
Get-Package -ProjectName {From Project} | Install-Package -ProjectName {Target Project} -IgnoreDependencies
```
> Same as above, but if you care about versions
```
```ps1
Get-Package -ProjectName {From Project} | % { Install-Package -ProjectName {Target Project} -IgnoreDependencies -Version $_.Version.ToString() $_.Id }
```
> Batch install packages
```
```ps1
("xunit","autofixture", "nsubstitute", "fluentassertions") | %{ Install-Package $_ -DependencyVersion Highest }
```
> Install package onto all projects
```
```ps1
Get-Project -All | Install-Package Microsoft.Net.Compilers
```
> Filter package upgrades
```
```ps1
Get-Package -Updates | ?{$_.Id -ne "refit"} | Update-Package
```
@@ -27,9 +27,11 @@ Make sure to modify the path variable to point to your Ghost installation folder
To start and stop is done with the following self explanatory commands.
`service ghost stop`
`service ghost start`
`service ghost restart`
```bash
service ghost stop
service ghost start
service ghost restart
```
### Explanation
@@ -14,14 +14,14 @@ Think `parted` if you're coming from Linux - but with a lot more functionality.
To use Diskpart, invoke it from the command line using:
```
```bat
X:\Sources> diskpart
DISKPART>
```
You can list all the disks available as so:
```
```bat
X:\Sources> diskpart
DISKPART> list disk
@@ -38,13 +38,13 @@ In the above example we have two disks, we will put both of these into our RAID1
Any mirror setup requires disks to be in dynamic mode - this is basically LVM under Linux. Dynamic disks can be used for a multitude of purposes like disk spanning, mirroring, striping, etc. Although, be careful, there's no going back from dynamic without formatting the disks completely.
Let's clean each disk before converting them, this uninitialize the disks without a partition scheme. After this disk is empty we enable dynamic mode.
```
```bat
DISKPART> select disk 0
DISKPART> clean
DISKPART> convert dynamic
```
And do the same thing with the second disk.
```
```bat
DISKPART> select disk 1
DISKPART> clean
DISKPART> convert dynamic
@@ -60,7 +60,7 @@ At this point we can create our RAID1 "partitions". I use "partitions" in quotes
Windows requires two partitions when in MBR mode (EFI requires 3, which I won't go into). One which is normally called `System Reserved` and the main OS partition normally without a name (`C:/`). Both of these partitions need to be created manually as the normal Windows installer cannot.
```
```bat
DISKPART> select disk 0
DISKPART> create volume mirror disk=0,1 size=500
DISKPART> format quick fs=ntfs label="System Reserved"
@@ -69,7 +69,7 @@ DISKPART> format quick fs=ntfs label="System Reserved"
These commands create a mirrored volume using disk `0` and `1` with a size of `500mb` (default size under Windows 2016). Then it formats the newly created (and automatically selected) volume using `ntfs` as the filesystem and "System Reserved" as the volume label.
Then we can create the OS partition using similar commands:
```
```bat
DISKPART> select disk 0
DISKPART> create volume mirror disk=0,1
DISKPART> format quick fs=ntfs
@@ -84,36 +84,36 @@ Using `list volume` we should see the list of volumes that we created. Note that
In the above setup, each volume represents a single logical "partition", but in reality each of these volumes spans two physical drives. These volumes are great under Windows, but not so useful to the BIOS attempting to bootstrap a OS. To make it possible for the BIOS to start Windows we need to create real partitions for each of our mirror volumes.
First let's use `detail disk` to make sure we target the correct volumes.
```
```bat
DISKPART> select disk 0
DISKPART> detail disk
```
In the picture, `volume 0` is our `System Recovery` volume and `volume 1` is our OS volume, different configurations may be different.
```
```bat
DISKPART> select disk 0
DISKPART> select volume 1
DISKPART> retain
```
This creates a real partition for volume 0 (System Recovery) on disk 0. Use `list partition` to find to again make sure to target the correct partition.
```
```bat
DISKPART> select disk 0
DISKPART> list partition
```
Our `System Recovery` partition is `500 MB`, in this example, this partition is `partition 1`.
To mark the newly created, real partition to be the boot partition we can use the following:
```
```bat
DISKPART> select disk 0
DISKPART> select partition 2
DISKPART> active
```
We need to do the same thing on the other drive too, as so:
```
```bat
DISKPART> select disk 1
DISKPART> select volume 1
DISKPART> retain
@@ -124,7 +124,7 @@ DISKPART> active
We also need a partition for the OS drive (required by the installer). This can be done using the same commands:
```
```bat
DISKPART> select disk 0
DISKPART> select volume 0
DISKPART> retain
Oops, something went wrong.

0 comments on commit eb92f78

Please sign in to comment.