Skip to content

Instantly share code, notes, and snippets.

@seif
seif / Machine.cs
Last active February 24, 2021 15:15
Get real number of cpus on machine, ignoring any quotas/limits.
namespace Utilities
{
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
public static class Machine
{
private const int MaximumNumberOfCpus = 128;
private static int? _processorCount;
@seif
seif / VBox.log
Created October 31, 2019 12:16
virtualbox ubuntu failure
00:00:00.778907 VirtualBox VM 6.0.14_Ubuntu r132055 linux.amd64 (Oct 17 2019 07:24:16) release log
00:00:00.778909 Log opened 2019-10-31T12:12:51.499472000Z
00:00:00.778910 Build Type: release
00:00:00.778913 OS Product: Linux
00:00:00.778914 OS Release: 5.3.0-19-generic
00:00:00.778915 OS Version: #20-Ubuntu SMP Fri Oct 18 09:04:39 UTC 2019
00:00:00.778934 DMI Product Name: 20FXS1HV01
00:00:00.778940 DMI Product Version: ThinkPad T460p
00:00:00.778973 Host RAM: 31545MB (30.8GB) total, 14928MB (14.5GB) available
00:00:00.778976 Executable: /usr/lib/virtualbox/VirtualBoxVM
Use of Mutation Events is deprecated. Use MutationObserver instead. contentscript.js:121:10
ember-i18n has been deprecated in favor of ember-intl ember-i18n.js:10
Asset version: 8c6208093ab2872cde9079f2712a3bc0be3cda53 controller.js:147
TypeError: "e.get is not a function"
state experiments.js:21
Ember 3
experiments experiments.js:25
Ember 3
variations experiments.js:37
Ember 2

Keybase proof

I hereby claim:

  • I am seif on github.
  • I am seif (https://keybase.io/seif) on keybase.
  • I have a public key ASBlz_zuh7mP-8xWoNa3P3UXvicDzntKYT_Pk5zicRDr8Ao

To claim this, I am signing this object:

@seif
seif / timeout.cs
Last active January 9, 2017 07:59
Mono WebRequest timeouts after ThreadPool exhaustion
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
public class Test
{
@seif
seif / out.txt
Created January 19, 2013 01:29
Git submodule update timeout
git clone https://github.com/sharparchitecture/Sharp-Architecture.git
Cloning into 'Sharp-Architecture'...
remote: Counting objects: 13801, done.
remote: Compressing objects: 100% (4190/4190), done.
remote: Total 13801 (delta 9338), reused 13551 (delta 9132)
Receiving objects: 100% (13801/13801), 85.33 MiB | 2.36 MiB/s, done.
Resolving deltas: 100% (9338/9338), done.
cd Sharp-Architecture
git submodule init
@seif
seif / gist:4452128
Created January 4, 2013 12:02
What is setting the mode?
localhost [2013-01-04T11:20:39+00:00] INFO: *** Chef 10.16.4 ***
localhost [2013-01-04T11:21:04+00:00] INFO: Run List is [recipe[chef-client], role[base], role[ravendb_server], role[Wiggle_Billing]]
localhost [2013-01-04T11:21:04+00:00] INFO: Run List expands to [chef-client, wiggle::prepare_windows, ms_dotnet35, ms_dotnet4, chocolatey, wiggle::ravendb, ms_messagequeue, Wiggle_Billing]
localhost [2013-01-04T11:21:05+00:00] INFO: Starting Chef Run for WIN-5SMRIK4TSD7.wiggledomain.wiggle.co.uk
localhost [2013-01-04T11:21:05+00:00] INFO: Running start handlers
localhost [2013-01-04T11:21:05+00:00] INFO: Start handlers complete.
localhost [2013-01-04T11:21:07+00:00] INFO: Loading cookbooks [Wiggle_Billing, chef-client, chef_handler, chocolatey, ms_dotnet35, ms_dotnet4, ms_messagequeue, powershell, teamcity, wiggle, windows]
localhost [2013-01-04T11:21:08+00:00] INFO: Powershell light-weight provider already initialized -- overriding!
localhost [2013-01-04T11:21:08+00:00] INFO: Powershell light-weight resource alr
@seif
seif / chef-stackreace.out
Last active December 10, 2015 07:18
template resource not notifying
Generated at 2013-01-02 23:06:59 +0000
RuntimeError: template[C:/Temp/bt97/1.8.9-alpha-01133/Deployment/Settings/CHEF.js] (Wiggle_Billing::default line /chef/cache/cookbooks/Wiggle_Billing/recipes/default.rb) had an error: RuntimeError: Must specify username, group or SID: 0
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.4/lib/chef/file_access_control/windows.rb:98:in `get_sid'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.4/lib/chef/file_access_control/windows.rb:306:in `target_owner'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.4/lib/chef/file_access_control/windows.rb:275:in `target_dacl'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.4/lib/chef/file_access_control/windows.rb:114:in `should_update_dacl?'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.4/lib/chef/file_access_control/windows.rb:45:in `requires_changes?'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.4/lib/chef/provider/file.rb:179:in `define_resource_requir
@seif
seif / default.rb
Created December 27, 2012 16:06
Mofied chef recipe
tc = Teamcity::Utility.new(:server=>"#{node.teamcity.server}", :port => 80, :username => "#{node.teamcity.username}", :password => "#{node.teamcity.password}")
build_version = tc.get_latest_build('bt134')
teamcity_build_type = 'bt134'
windows_batch "run_dropkick" do
code <<-EOH
cd C:\\Temp\\#{teamcity_build_type}\\#{build_version}\\Deployment
execute-#{node.chef_environment}-all.bat
EOH
@seif
seif / default.rb
Last active December 10, 2015 05:38 — forked from anonymous/default.rb
tc = Teamcity::Utility.new(:server=>"#{node.teamcity.server}", :port => 80, :username => "#{node.teamcity.username}", :password => "#{node.teamcity.password}")
build_version = tc.get_latest_build('bt134')
teamcity_build_type = 'bt134'
teamcity_build "download-artefact" do
build_type teamcity_build_type
version build_version
destination "C:\\Temp\\#{teamcity_build_type}\\#{build_version}.zip"
overwrite true