Skip to content

Instantly share code, notes, and snippets.

View stephaneerard's full-sized avatar

Stéphane Erard stephaneerard

  • Pragmatism & Enthusiasm
  • Nice, France
View GitHub Profile
# /etc/udev/rules.d/usb.rules -> symbolic link to another file
ACTION=="add", KERNEL="sd*", SUBSYSTEMS=="usb", DRIVERS=="usb-storage", RUN+="/home/vagrant/test.sh"
# my usb key can be mount as sudo mount /dev/sdb /mnt/usb and it works
# sudo udevadm control --reload-rules
# monitoring using udevadm monitoring
# plugging in usb host via virtualbox, and get nothing, while monitoring shows :
KERNEL[5377.864249] remove /devices/pci0000:00/0000:00:0b.0/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0/bsg/2:0:0:0 (bsg)
jenkins_slaves_ips = {
00 => "192.168.54.5",
01 => "192.168.54.6",
02 => "192.168.54.7",
}
How to loop over this hash ?
jenkins_slaves_ips.each |nb|
puts "#{nb}"
ERROR warden: Error occurred: An error occurred in the underlying SSH library that Vagrant uses.
The error message is shown below. In many cases, errors from this
library are caused by ssh-agent issues. Try disabling your SSH
agent or removing some keys and try again.
If the problem persists, please report a bug to the net-ssh project.
steph@LAPTOP-0BADHT0N MINGW64 /c/code/v1/mvp0-level0 (develop)
$ VAGRANT_LOG=info vagrant up apt
INFO global: Vagrant version: 2.2.2
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_EXECUTABLE="C:\\apps\\Vagrant\\embedded\\gems\\2.2.2\\gems\\vagrant-2.2.2\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\apps\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="info"
@stephaneerard
stephaneerard / gist:dad427d25639159667dbdbb1cdbb5342
Created January 16, 2019 00:04
Debug webdriverio + selenium-standalone
Initializing GitLab Endpoint http://192.168.54.6 with init password kp*%!4R89d8Dy*
Selenium is installed
Selenium starting
Selenium started
2019-01-15T23:55:35.379Z DEBUG wdio-config: @wdio/sync not found, running tests asynchronous
2019-01-15T23:55:35.562Z INFO webdriver: [POST] http://0.0.0.0:4444/wd/hub/session
2019-01-15T23:55:35.562Z INFO webdriver: DATA { capabilities:
{ alwaysMatch: { browserName: 'firefox' }, firstMatch: [ {} ] },
desiredCapabilities: { browserName: 'firefox' } }
2019-01-15T23:56:25.840Z DEBUG webdriver: request failed due to status 33
#!/usr/local/bin bash
brew cask install virtualbox
brew cask install vagrant
brew cask install packer
vagrant init debian/contrib-buster64
vagrant up
echo you can now run vagrant ssh
@stephaneerard
stephaneerard / ad.user.create.ps1
Created September 3, 2020 07:48
PoSh 7 Create ad user
Set-PSDebug -Trace 0
$GroupName = "bla"
$SafeModePassword = "blaaaa" #not correct
$DomainName = "$GroupName.local"
$props=@{
EmailAddress = "test-user@$DomainName"
Name = 'test-user'
Path = "OU=New Hire,OU=Users,DC=$GroupName,DC=local"
# create local admin
$Username = 'localadmin'
$Password = 'l0ng-p4ssw0rd'
$SecuredPassword = (ConvertTo-SecureString -AsPlainText -Force $Password)
$group = "Administrators"
$newLocalUserParams = @{
AccountNeverExpires = $true
Password = $SecuredPassword
INFO interface: detail: Add-WindowsCapability -Online -Name Rsat.RemoteAccess.Management.Tools
INFO interface: detail: win-srv: Add-WindowsCapability -Online -Name Rsat.RemoteAccess.Management.Tools
win-srv: Add-WindowsCapability -Online -Name Rsat.RemoteAccess.Management.Tools
INFO interface: detail: Path :
INFO interface: detail: win-srv: Path :
win-srv: Path :
INFO interface: detail: Online : True
INFO interface: detail: win-srv: Online : True
win-srv: Online : True
INFO interface: detail: Add-WindowsCapability -Online -Name Rsat.RemoteDesktop.Services.Tools
// test file .ps1 which can be executed and debugged using vscode in my case
param(
)
Describe "New-SoftwareProject" {
BeforeAll {
$beforeDir = Get-Location
Import-Module -Name "$PSScriptRoot/../.infra/Utils"