Skip to content

Instantly share code, notes, and snippets.

[00012937][01 00] Firmware upgrade finished successfully.
[00013055]Done.
[00013086]Packet [C:\P3S_FW_V01.11.0020.bin] resumed, card sn [0x90ce7f72].
[00013128]Packet vlink 01.11.0020 <-> 01.11.0020.
[00013202]Version checking[2]...
[00013262][03 06][00] v2.1.6.18 -> v2.4.20.50 need upgrade.
[00013322][03 05][00] v34.2.0.9 -> v34.2.0.9
[00013369][04 00][00] v1.38.0.0 -> v1.48.0.0 need upgrade.
[00013463][11 00][00] v1.6.1.0 -> v1.8.0.0 need upgrade.
@technion
technion / Get-VM-using-Virtualdisk.ps1
Last active August 5, 2020 00:55
Scan a virtualdisk for VMs that are using it
# Please set these two variables
$scanpath = "C:\ClusterStorage\SilverTier1"
$clustername = "cls.cluster.mycluster.cluster.cls"
Set-StrictMode -Version 2
$nodes = Get-ClusterNode -Cluster $clustername
foreach ($node in $nodes) {
write-host "Processing node $($node.Name)"
@technion
technion / Crypto Cheat Sheet.md
Last active October 21, 2018 08:52
Crypto cheat sheet

Weaknesses

ECB mode - unauthenticated Cut and paste blocks Chosen plaintext - use length controlled input for byte at a time decryption

CBC mode - unauthenticated Bitflipping attack to alter message CBC padding oracle decryption

@technion
technion / modeven.v
Last active June 7, 2018 10:58
Mod Even
Require Import Coq.Arith.Arith.
Require Import Coq.Arith.EqNat.
(* Definition from : https://coq.inria.fr/library/Coq.Arith.Even.html *)
Inductive even : nat -> Prop :=
| even_O : even 0
| even_S : forall n, odd n -> even (S n)
with odd : nat -> Prop :=
odd_S : forall n, even n -> odd (S n).
@technion
technion / getzones.rb
Created June 6, 2018 02:44
Export all Route 53 zones
#!/usr/bin/env ruby
zones = `./cli53-linux-amd64 l --profile d53`.lines
zones.each do |zone|
domain = zone.split(/\s+/)[1]
`./cli53-linux-amd64 export #{domain} --profile d53 > #{domain}.zone`
puts domain
end
@technion
technion / dial.erl
Created April 28, 2018 09:13
Erlang dialyzer demo
dial.erl
-module(dial).
-export([dial/0]).
addthree(X) ->
X + 3.
dial() ->
Y = addthree(2),
io:fwrite("~p~n", [Y]).
$VMs = import-csv -path '.\build list.csv'
$VMLOC = "C:\ClusterStorage\GoldTier03\iuhuih\"
$ISO = "C:\ClusterStorage\SilverTier1\ISO\SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_English_-3_MLF_X21-30350.ISO"
foreach ($vm in $VMs) {
write-host "Creating VM " $vm.Name "With C: " $vm.C "and ram" $vm.RAM
$disksize = [int]$($vm.C) * 1024*1024*1024 #Convert byte string to GB
New-VM -Name $vm.Name -Path ${VMLOC} -MemoryStartupBytes 2GB -NewVHDSizeBytes $disksize -SwitchName vSwitch1 -Generation 2 -NewVHDPath "$($VMLOC)$($vm.Name)\disk-1.vhdx"
Get-VM -VM $vm.Name | Set-VMNetworkAdapterVlan -Access -Vlanid 1205
$ramsize = [int]$($vm.RAM) * 1024*1024*1014 #Convert byte string to GB
@technion
technion / Password References.md
Last active May 2, 2024 23:32
A set of references on modern password policies

References on modern password policies

Below links provide source, reference link and relevant quote

Standards

NIST

https://github.com/usnistgov/800-63-3/blob/nist-pages/sp800-63b/sec5_authenticators.md

Verifiers SHOULD NOT impose other composition rules (e.g., requiring mixtures of different character types or prohibiting consecutively repeated characters) for memorized secrets. Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically).However, verifiers SHALL force a change if there is evidence of compromise of the authenticator.

Major organisations

module ApplicationHelper
# Use a hash so there's a bit of work to serialize
DATA = [data: 'a secret cookie', second: 'another string']
N = 100000
def storebench
# Setup keying. Really, secret and sign_secret should just get saved.
key_generator = ActiveSupport::KeyGenerator.new(Rails.application.secrets.secret_key_base, iterations: 1000)
secret = key_generator.generate_key('encrypted cookie')
sign_secret = key_generator.generate_key('signed encrypted cookie')
#!/usr/bin/env ruby
("1000000000".to_i(16)).upto("FFFFFFFFFF".to_i(16)) do |n|
puts n.to_s(16).upcase
puts n.to_s(16)
end