Skip to content

Instantly share code, notes, and snippets.

View kikitux's full-sized avatar

Alvaro Miranda Aguilera kikitux

View GitHub Profile
<domain type='kvm'>
<name>trusty</name>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-1.2'>hvm</type>
<boot dev='hd'/>
</os>
@kikitux
kikitux / gist:38208e1acd41f0c5de0e
Last active December 21, 2021 14:23
Vagrant virtualbox shared disks
give_info = "true"
count_shared_disk = 2
size_shared_disk = 10
#path_shared_disk = "/some/path"
config.vm.provider :virtualbox do |vb|
vb.name = vm_name_db + "." + Time.now.strftime("%y%m%d%H%M")
vb.customize ["modifyvm", :id, "--memory", memory_DB_INSTANCES]
vb.customize ["modifyvm", :id, "--cpus", num_CORE]
vb.customize ["modifyvm", :id, "--groups", "/collab"]
#first shared disk port
#enable rdp
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name fDenyTSConnections -Type DWord -Value 0
#remove NLA
# NLA (Network Level Authentication)
$NLA = Get-WmiObject -Class Win32_TSGeneralSetting -ComputerName "." -Namespace root\CIMV2\TerminalServices -Authentication PacketPrivacy
#0 disable
#1 enable
$NLA.SetUserAuthenticationRequired(0)
# Recreate the WMI object so we can read out the (hopefully changed) setting
@kikitux
kikitux / Vagrantfile
Last active January 3, 2018 23:14
vagrant-sphere sample Vagrantfile
#settings for vm
#name of vm to current directory
vm_prefix = Pathname.new(Dir.getwd).basename.to_s
vm_folder = "vagrant-vsphere/#{vm_prefix}"
vm_number = 3
vm_ram = 1024
vm_cpu = 2
vm_datastore = "sas"
#scripts
@kikitux
kikitux / intfibdijkstra.cpp
Created August 29, 2015 09:21
Fibonacci C++ Using Vector
// http://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD654.html
// http://www.cs.utexas.edu/users/EWD/ewd06xx/EWD654.PDF
// F(2n) = (2*F(n-1) + F(n) )*F(n)
// F(2n-1) = F(n-1)^2 + F(n)^2
unsigned long intfibdijkstra(unsigned long n) {
static std::vector<unsigned long> values = {0,1,1};
if (n == 0 ) {
return values[n];
@kikitux
kikitux / Vagrantfile.rb
Created January 3, 2016 10:02
2 node Vagrantfile
#configuration of host resolv
$resolv = <<-EOF
cat > /etc/resolv.conf <<EOF2
search local
nameserver 127.0.0.1
EOF2
EOF
$hosts = <<-EOF
@kikitux
kikitux / zerkms
Last active March 24, 2016 03:34
------------ zerkms is kind again below this line -----------
:zerkms:
key=ENV['key']
vars = Hash.new
vars["key"]=ENV['key']
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.provision "shell", inline: "echo var key=#{key}"
config.vm.provision "shell", path: "provision.sh", args: "arg1", env: vars
end
function checkField(element, parent)
{
if ($(element).attr("type") == "radio") {
if ($("input[name=" + $(element).attr("name") + "]:checked").length > 0) {
if (!$(element).parent().hasClass("filled")) {
if ($(parent).data("required").filled < ($(parent).data("required").total)) {
$(parent).data("required").filled++;
$(element).parent().addClass("filled");
}
}
@kikitux
kikitux / shaila
Created August 10, 2016 09:07
james_dinnes
q