Skip to content

Instantly share code, notes, and snippets.

View geo-stanciu's full-sized avatar

Geo Stanciu geo-stanciu

  • Bucharest, Romania
View GitHub Profile
@geo-stanciu
geo-stanciu / Convert Oracle VirtualBox Machines to vSphere and XEN
Last active July 10, 2018 14:02
Convert Oracle VirtualBox Machines to vSphere / XEN
Sources:
https://jekil.sexy/blog/2015/this-ovf-package-requires-unsupported-hardware.html
https://superuser.com/questions/245775/is-there-a-built-in-checksum-utility-on-windows-7/898377#898377
https://lukebarklimore.wordpress.com/2012/10/25/esxi-5-1-fixing-failed-to-deploy-ovf-package-the-task-was-canceled-by-a-user/
Download, install VMware Open Virtualization Format Tool (and put it in your path variable)
https://communities.vmware.com/community/vmtn/server/vsphere/automationtools/ovf
Now you can convert the OVA in an OVF
ovftool.exe --lax source.ova destination.ovf
@geo-stanciu
geo-stanciu / Disable SSL 2 and SSL4 and fix RC4 issues on Windows Server.txt
Last active July 10, 2018 11:47
Disable SSL 2 and SSL4 and fix RC4 issues on Windows Server
/*
Copyright (c) 2018, Gheorghita Stanciu gheorghita(dot)stanciu(at)gmail(dot)com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
@geo-stanciu
geo-stanciu / Keep x backup files.go
Last active July 10, 2018 11:46
Keep x backup files
/*
Copyright (c) 2018, Gheorghita Stanciu gheorghita(dot)stanciu(at)gmail(dot)com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
@geo-stanciu
geo-stanciu / char matrix + strdup_printf example.cpp
Last active July 10, 2018 11:46
char matrix add + free + strdup_printf example
/*
Copyright (c) 2018, Gheorghita Stanciu gheorghita(dot)stanciu(at)gmail(dot)com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
@geo-stanciu
geo-stanciu / golang - sha256.go
Last active September 13, 2018 08:34
golang - sha256 files
/*
Copyright (c) 2018, Gheorghita Stanciu gheorghita(dot)stanciu(at)gmail(dot)com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
@geo-stanciu
geo-stanciu / mysql - set database utf8.sql
Created October 12, 2018 18:09
mysql - set database utf8
ALTER DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON dbname to 'geo'@'%';
GRANT ALL PRIVILEGES ON dbname.* to 'geo'@'%';
FLUSH PRIVILEGES;
@geo-stanciu
geo-stanciu / delete duplicate row.sql
Last active August 6, 2019 17:31
mysql + postgres - delete duplicate row
-- delete duplicate rss - postgresql
DELETE FROM rss T1
USING rss T2
WHERE T1.ctid < T2.ctid
AND T1.rss_source_id = T2.rss_source_id
AND T1.title = T2.title
AND T1.link = T2.link;
-- delete duplicate rss - mysql
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
host replication all 0.0.0.0/0 md5
@geo-stanciu
geo-stanciu / my.ini
Created November 30, 2018 20:42
my.ini
[mysqld]
datadir=D:/MariaDB 10.3/data
port=3306
innodb_buffer_pool_size=2045M
log-bin=binlog
max-binlog-size=500M
server-id=1
[client]
port=3306
plugin-dir=D:/MariaDB 10.3/lib/plugin
@geo-stanciu
geo-stanciu / c - get current locat time.c
Created February 8, 2019 16:02
c - get current locat time
#include <time.h>
time_t rawtime;
struct tm * timeinfo;
time(&rawtime);
timeinfo = localtime(&rawtime);
setlocale(LC_ALL, "C");
strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", now);