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
# 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 / 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
@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 / 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 / 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 / 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 / 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 / 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 / setup ubuntu-server
Last active May 26, 2018 15:40
setup ubuntu-server
# get iso
wget http://releases.ubuntu.com/16.04.4/ubuntu-16.04.4-server-amd64.iso
# create vm path
mkdir -p /backup/virtual_machines/LicensePlates/Snapshots
cd /backup/virtual_machines/LicensePlates
# VM name
VM='LicensePlates'
@geo-stanciu
geo-stanciu / Java - Crystal Reports
Created March 16, 2018 09:49
Java - Crystal Reports
# CRConfig.xml
<?xml version="1.0" encoding="utf-8"?>
<CrystalReportEngine-configuration>
<!-- <reportlocation>/reports</reportlocation> -->
<timeout>10</timeout>
<keycode>MyLicenseKeyCodeHere</keycode>
</CrystalReportEngine-configuration>
# log4j.properties