Skip to content

Dumping and importing from/to MySQL in an UTF-8 safe way

In a nutshell: to avoid your shell character set from messing with imports, use -r to export and SOURCE when importing. Dumping safely Do not do this, since it might screw up encoding: mysqldump -uroot -p database > utf8.dump # this is bad Better do: mysqldump -uroot -p database -r utf8.dump Note that when your …

Check all SQL table size

With this simple query, you can find size of all tables on sql database EXEC sp_MSforeachtable @command1=”EXEC sp_spaceused ‘?’” otherwise if you need to check a single table you can use the following query exec sp_spaceused tablename;

SG500X and SFP 1GBit

New firmware release version 1.3.0.62 contain a bug and with 1Gbit SFP inserted into XG ports, cause a fatal error and switch continues reboot itself. Downgrade to 1.2.9.44

2gbsparse doesn’t work on ESXi 5.1

2gbsparse does work, but you’ll need to enable a VMkernel module (looks like it’s disabled in 5.1 by default) but there’s also mention of this in vSphere 5.1 release notes   # Load multiextent module esxcli system module load -m multiextent

Forcing A Cisco Catalyst Switch To Use 3rd Party SFP Modules

If you’ve just replaced your network switches and tried using any 3rd party SFPs to connect your network backbone, you’ll quickly stumble across an error similar to the following: %PHY-4-UNSUPPORTED_TRANSCEIVER: Unsupported transceiver found in Gi1/0/0 %GBIC_SECURITY_CRYPT-4-VN_DATA_CRC_ERROR: GBIC in port 65538 has bad crc Congratulations!  The Catalyst switch has just disabled the GBIC port! This happens …

Redirect http to https web page on IIS7

Firstly install URL Rewrite from here. Then open web.config of website you want redirect and add the following rule between the rules tag <rule name=”HTTP to HTTPS redirect” enabled=”true” stopProcessing=”true”> <match url=”(.*)” /> <conditions> <add input=”{HTTPS}” pattern=”off” ignoreCase=”true” /> </conditions> <action type=”Redirect” redirectType=”Found” url=”https://{HTTP_HOST}/{R:1}” /> </rule>

Release memory in Linux (Unused or Cached)

In computer science, Memory Leakage occurs when a computer software or  program consumes required memory but unable to memory after completing its task  or when no longer needed to Operating System. There are two types of Memory Leakage. One is  Virtual Memory Leakage and another is Real Memory Leakage. Now first Identify cached memory or …

OOM killer exception

With the following command you can create and exception on OOM killer so that it will not kill specified PID process # OOM_DISABLE on $PID echo -17 > /proc/$PID/oom_adj To automate the exception creation you can use the following command to retrive the pid of specific process pgrep -f “/usr/sbin/sshd” | while read PID; do …

Adaptec 3805 CIM for ESXi5

Install CIM provider 7.30 attached (downloaded from Adaptec web site) cim_vmware_v7_30_18837 esxcli software vib install -f -v file:/vmfs/volume/datastore1/filename.vib Open ESXi firewall to CIM provider port Create symbolic link on esxi ln -s /dev/aac0 /dev/aac I have not yet checked what happens on esxi reboot if link is lost (I think)