HOWTO wipe space on Hetzner Root Server

If your worry about data left on dedicated/hosted root server and want to remove secure all files and bits,
you can clean complete disk slice or even better to overwrite with random bytes.

DATA CAN'T BE RECOVERED ANY MORE! YOU WILL PROCEED AT YOUR OWN RISK!

1. Start Rescue system from Robot.
The Rescue System can be activated from Robot. After choosing the desired server from the server overview (Menu "Server" -> click on the desired server) go to the tab "Rescue". Here you can activate the Rescue System. After activating the Rescue System an automatically generated password is displayed. Please make a careful note of it as this is the root password of the Rescue System.

2. Login into Rescue System using ssh
3a. If you use default server with RAID 1 (example for an EX server) execute
# dd if=/dev/urandom of=/dev/md2 bs=1M


3b. Or if you use a hardware RAID controller has been installed or the server only has one drive (VQ servers) execute
#  dd if=/dev/urandom of=/dev/sda3 bs=1M

Care of your personal data!


Free PHP, HTML, CSS, JavaScript editor (IDE) - Codelobster PHP Edition

Free PHP, HTML, CSS, JavaScript editor (IDE) - Codelobster PHP Edition
For valuable work on creation of sites you need a good comfortable editor necessarily. There are many requiring paid products for this purpose, but we would like to select free of charge very functional and at the same time of simple in the use editor - Codelobster PHP Edition .
    Let us consider some important possibilities and advantages of this program:
  • All code highlights depending on a type, the also mixed code is thus supported, so the area of HTML will be highlighted as HTML, PHP as PHP, and Javascript as Javascript in a the same file. Thre is possibility of choice from color schemes, including popular IDEs.
  • Powerful autocompletion for HTML, PHP, CSS and Javascript, including HTML5 and CSS3. For PHP the structure of project is fully recognized, and the complete list of methods falls out in the proper places.
  • HTML/CSS inspector on the type of Firebug, which allows easily to correlate the selected elements of page with a code and proper style.
  • Context help on all supported languages. By pressing F1 key the page with detailed description for current tag, attribute or function will be opened.
  • PHP debugger. PHP debugger allows to execute PHP scripts incrementally, watching the values of all variables in every line.
  • SQL manager allows to produce all necessary actions with a database - to add, delete, edit a structure and records in tables, to export data, execute SQL queries. Highlighting and autocompletion works for SQL files also.
  • Support of FTP allows to work straight with a remote server and to do all necessary changes with files;
  • The portable option allows to use editor without the preliminary installation.
  • Other useful utilities: pair highlighting, possibility of blocks selection, collapsing, tooltips, navigation on descriptions of functions and included files at withholding of the key of CTRL, viewing of structure of files and project, preview in a browser, book-marks, and all other standard possibilities for work with a code.

Also there are special plugins for work with


  • CMS: Drupal, Joomla
  • PHP frameworks: CakePHP, CodeIgniter, Symfony, Yii
  • JavaScript libraly: JQuery
  • WordPress blogging engine
  • Smarty template engine

Developer Codelobster Software
Web Site http://www.codelobster.com/
Language English, Russian, German, Spanish, French, Portuguese
Supported OS Windows 2000, Windows XP, Windows Vista, Windows 7

[SOLVED] who has locked mysql table?!

Occasionally appears error message “Lock wait timeout exceeded, INSERT INTO table failed.” between 01am and 05am in one of the applications. Can you imagine DBA the whole night long sitting  and waiting for error message? I also can’t, but need to find the reason of locks and discover process. Thus when new record in error log appears it must be performed some necessary SQL commands. In unix world you can use inotifywait/gamin to watch file changes and mysql client to execute sql commands.
 My biggest problem was the mysql server running on windows platform and absence of nice utilities. On my luck windows has FindFirstChangeNotification Win32 API function. I have created small tool which listens a directory for changes and execute

SHOW FULL PROCESSLIST

SHOW OPEN TABLES

SHOW ENGINE INNODB STATUS

 Results will be written to console.

Usage MySql_Monitor.exe -h HOST -u USERNAME -pSOMEPASS -d DBNAME c:\tmp\WATCHED_DIR\

Example: MySql_Monitor.exe -h localhost -u root -p -d somedb c:\tmp\log\ > output.txt

You can take exe file or sources here.
Enjoy!

ld.exe cannot open some.exe file - Permission denied

ld.exe allows to make only once and next time appears always message ld.exe cannot open <same>.exe file - Permission denied.
Google doesn't help me with the issue and I took in hand procmon.
windows indexing service was at fault for this problem.
Solution: exclude current folder from index.

Enjoy! and thanks sysinternals for best tools!

ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error

ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error :(
To eliminate the error, you can create file IE10.browser to the folder located at %SystemRoot%\Microsoft.NET\Framework\version\CONFIG\Browsers on your system. and execute C:\WINDOWS\Microsoft.NET\Framework\\aspnet_regbrowsers.exe -i

IE10.browser content

<browsers>
    <browser id="IE10" parentID="IE">
        <identification>
            <capability name="majorversion" match="^10" />

        </identification>

        <capture>
        </capture>

        <capabilities>
            <capability name="activexcontrols"     value="true" />
            <capability name="backgroundsounds"    value="true" />
            <capability name="cookies"             value="true" />
            <capability name="css1"                value="true" />
            <capability name="css2"                value="true" />
            <capability name="ecmascriptversion"   value="1.2" />
            <capability name="frames"              value="true" />
            <capability name="javaapplets"         value="false" />
            <capability name="javascript"          value="true" />
            <capability name="jscriptversion"      value="6.0" />
            <capability name="msdomversion"        value="${majorversion}${minorversion}" />
            <capability name="supportsCallback"    value="true" />
            <capability name="supportsFileUpload"  value="true" />
            <capability name="supportsMultilineTextBoxDisplay" value="true" />
            <capability name="supportsMaintainScrollPositionOnPostback" value="true" />
            <capability name="supportsVCard"       value="true" />
            <capability name="supportsXmlHttp"     value="true" />
            <capability name="tables"              value="true" />
            <capability name="tagwriter"           value="System.Web.UI.HtmlTextWriter" />
            <capability name="vbscript"            value="false" />
            <capability name="w3cdomversion"       value="1.0" />
            <capability name="xml"                 value="true" />
        </capabilities>

        <controlAdapters />

    </browser>
</browsers>

Notepad++ Function List


notepad++ has built-in function list starting from version 6.4. At the moment only C++ and JavaScript are supporting.

Follow next releases and enjoy!

Internet Information Services IIS 8.5: What’s New in Window Server 2012 R2

With the release of the new version of Windows Server 2012 R2 comes a new version of IIS, IIS 8.5.  The new features can be broken into 2 categories, Scalability and Manageability:
  • Manageability - Logging Enhancements
  • Manageability - ETW Events
  • Scalability - Dynamic site activation
  • Scalability - Idle Worker Process Page-out
The following article contains a brief explanation of the new features.  For a very nice and more in-depth walk through of these new features, access the information by watching this Channel9 video “Internet Information Services: What’s New in Window Server 2012 R2 Internet Information Services: What’s New in Window Server 2012 R2” here.

Dynamic site activation

When you are hosting a lot of web sites (100s) in IIS version 6/7/7.5, you may have experienced some noticable time when loading the IIS configuration file.  When WAS runs it will load the configuration for all web sites hosted on the server.  In IIS 8.5 a new more optimized process has been implemented to improve the performance of this activity.  Note: There were also many improvements in this area found in IIS 8.0.


IIS 8.5 Preview Download

Lookup SPF record in C#

We have retrieved already MX and SRV records. Now let's take SPF record from DNS server. SPF string is TXT record(s) and if you are looking for google.com record proceed with
nslookup -type=TXT google.com

Csharp class looks like

public class nDnsQuery
    {
        public nDnsQuery()
        {
        }

        [DllImport("dnsapi", EntryPoint = "DnsQuery_W", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
        private static extern int DnsQuery([MarshalAs(UnmanagedType.VBByRefStr)]ref string pszName, QueryTypes wType, QueryOptions options, int aipServers, ref IntPtr ppQueryResults, int pReserved);

        [DllImport("dnsapi", CharSet = CharSet.Auto, SetLastError = true)]
        private static extern void DnsRecordListFree(IntPtr pRecordList, int FreeType);

  

        public static string[] GetSPFRecords(string domain)
        {

            IntPtr ptr1 = IntPtr.Zero;
            IntPtr ptr2 = IntPtr.Zero;
            SPFRecord recSPF;
            if (Environment.OSVersion.Platform != PlatformID.Win32NT)
            {
                throw new NotSupportedException();
            }
            ArrayList list1 = new ArrayList();
            try
            {

                int num1 = nDnsQuery.DnsQuery(ref domain, QueryTypes.DNS_TYPE_TEXT, QueryOptions.DNS_QUERY_BYPASS_CACHE, 0, ref ptr1, 0);
                if (num1 != 0)
                {
                    if (num1 == 9003)
                    {
                        list1.Add("DNS record does not exist");
                    }
                    else
                    {
                        throw new Win32Exception(num1);
                    }
                }
                for (ptr2 = ptr1; !ptr2.Equals(IntPtr.Zero); ptr2 = recSPF.pNext)
                {
                    recSPF = (SPFRecord)Marshal.PtrToStructure(ptr2, typeof(SPFRecord));
                    if (recSPF.wType == (ushort)QueryTypes.DNS_TYPE_TEXT)
                    {
                        for (int i = 0; i < recSPF.dwStringCount; i++)
                        {
                            IntPtr pString = recSPF.pStringArray + i;
                            string text1 = Marshal.PtrToStringAuto(pString);
                            if (text1.Contains("v=spf1") || text1.Contains("spf2.0"))
                            {
                                list1.Add(text1);
                            }
                        }
                    }
                }
            }
            finally
            {
                nDnsQuery.DnsRecordListFree(ptr1, 0);
            }
            return (string[])list1.ToArray(typeof(string));
        }

        private enum QueryOptions
        {
            DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE = 1,
            DNS_QUERY_BYPASS_CACHE = 8,
            DNS_QUERY_DONT_RESET_TTL_VALUES = 0x100000,
            DNS_QUERY_NO_HOSTS_FILE = 0x40,
            DNS_QUERY_NO_LOCAL_NAME = 0x20,
            DNS_QUERY_NO_NETBT = 0x80,
            DNS_QUERY_NO_RECURSION = 4,
            DNS_QUERY_NO_WIRE_QUERY = 0x10,
            DNS_QUERY_RESERVED = -16777216,
            DNS_QUERY_RETURN_MESSAGE = 0x200,
            DNS_QUERY_STANDARD = 0,
            DNS_QUERY_TREAT_AS_FQDN = 0x1000,
            DNS_QUERY_USE_TCP_ONLY = 2,
            DNS_QUERY_WIRE_ONLY = 0x100
        }

        private enum QueryTypes
        {
            DNS_TYPE_A = 0x0001,
            DNS_TYPE_MX = 0x000f,
            DNS_TYPE_TEXT = 0x0010,
            DNS_TYPE_SRV = 0x0021
        }

  

        [StructLayout(LayoutKind.Sequential)]
        private struct SPFRecord
        {
            public IntPtr pNext;
            public string pName;
            public ushort wType;
            public ushort wDataLength;
            public int flags;
            public int dwTtl;
            public int dwReserved;
            public Int32 dwStringCount;
            public IntPtr pStringArray;
        }

    }

You can take full sources here.

Enjoy!

Lookup SRV record in C#

Similar to MX lookup, we can use WINAPI DnsQuery from csharp to complete DNS SRV request.
You can take sources here.

public class nDnsQuery
    {
        public nDnsQuery()
        {
        }

        [DllImport("dnsapi", EntryPoint = "DnsQuery_W", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
        private static extern int DnsQuery([MarshalAs(UnmanagedType.VBByRefStr)]ref string pszName, QueryTypes wType, QueryOptions options, int aipServers, ref IntPtr ppQueryResults, int pReserved);

        [DllImport("dnsapi", CharSet = CharSet.Auto, SetLastError = true)]
        private static extern void DnsRecordListFree(IntPtr pRecordList, int FreeType);

  
        public static string[] GetSRVRecords(string needle)
        {

            IntPtr ptr1 = IntPtr.Zero;
            IntPtr ptr2 = IntPtr.Zero;
            SRVRecord recSRV;
            if (Environment.OSVersion.Platform != PlatformID.Win32NT)
            {
                throw new NotSupportedException();
            }
            ArrayList list1 = new ArrayList();
            try
            {

                int num1 = nDnsQuery.DnsQuery(ref needle, QueryTypes.DNS_TYPE_SRV, QueryOptions.DNS_QUERY_BYPASS_CACHE, 0, ref ptr1, 0);
                if (num1 != 0)
                {
                    if (num1 == 9003)
                    {
                        list1.Add("DNS record does not exist");
                    }
                    else
                    {
                        throw new Win32Exception(num1);
                    }
                }
                for (ptr2 = ptr1; !ptr2.Equals(IntPtr.Zero); ptr2 = recSRV.pNext)
                {
                    recSRV = (SRVRecord)Marshal.PtrToStructure(ptr2, typeof(SRVRecord));
                    if (recSRV.wType == (ushort)QueryTypes.DNS_TYPE_SRV)
                    {
                        string text1 = Marshal.PtrToStringAuto(recSRV.pNameTarget);
                        text1 += ":" + recSRV.wPort;
                        list1.Add(text1);
                    }
                }
            }
            finally
            {
                nDnsQuery.DnsRecordListFree(ptr1, 0);
            }
            return (string[])list1.ToArray(typeof(string));
        }

        private enum QueryOptions
        {
            DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE = 1,
            DNS_QUERY_BYPASS_CACHE = 8,
            DNS_QUERY_DONT_RESET_TTL_VALUES = 0x100000,
            DNS_QUERY_NO_HOSTS_FILE = 0x40,
            DNS_QUERY_NO_LOCAL_NAME = 0x20,
            DNS_QUERY_NO_NETBT = 0x80,
            DNS_QUERY_NO_RECURSION = 4,
            DNS_QUERY_NO_WIRE_QUERY = 0x10,
            DNS_QUERY_RESERVED = -16777216,
            DNS_QUERY_RETURN_MESSAGE = 0x200,
            DNS_QUERY_STANDARD = 0,
            DNS_QUERY_TREAT_AS_FQDN = 0x1000,
            DNS_QUERY_USE_TCP_ONLY = 2,
            DNS_QUERY_WIRE_ONLY = 0x100
        }

        private enum QueryTypes
        {
            DNS_TYPE_A = 0x0001,
            DNS_TYPE_MX = 0x000f,
            DNS_TYPE_SRV = 0x0021
        }

  
        [StructLayout(LayoutKind.Sequential)]
        private struct SRVRecord
        {
            public IntPtr pNext;
            public string pName;
            public ushort wType;
            public ushort wDataLength;
            public int flags;
            public int dwTtl;
            public int dwReserved;
            public IntPtr pNameTarget;
            public ushort wPriority;
            public ushort wWeight;
            public ushort wPort;
            public ushort Pad;
        }
    }
Enjoy!

HOWTO create php function list

I have tried to use php reflections with no success to examine php class.
After that i found phpdoc which creates full list of methods etc just in a second.
It was really easy against expectation. And now I can see php function list nice formated

$ phpdoc -o HTML:frames:earthli -d -myclasses -t docs

and result looks like



Enjoy!

HOWTO list all my java class methods

Similar to C# function list, you can list java class or jar file details.
I have written small utility to find all methods using java reflection.

Please note it uses platform depended SWT library.
Windows: javaFunctions_x86_win32.jar
Linux: javaFunctions_linux.jar

Result can be

Enjoy!

C# real function list

An assembly (DLL, EXE etc) can contain different classes. And class can contain a lot of methods.
You know already about reflection, but you need quickly look up the function list.

I have written yet another c sharp assembly explorer, please take here.




Enjoy!

OTRS Only tickets are shown in queues where agents have "rw" permission

OTRS - Hat ein Benutzer nur Leserechte (ro) auf eine Queue werden keine Tickets angezeigt
user with readonly (RO) permissions can find tickets, but can't see tickets by default in AgentQueueView because tickets are not listed.
To resolve the issue search in SysConfig for ViewAllPossibleTickets and set 

Ticket::Frontend::AgentTicketQueue###ViewAllPossibleTickets to Yes.

$Self->{'Ticket::Frontend::AgentTicketQueue'}->{'ViewAllPossibleTickets'} =  '1';


Enjoy!

notepad++ auto update deaktivieren

you have several options to disable auto-update in notepad++.
Note: you are disabling updates on your own! Be safe!

First option to reinstall notepad++ and un-check "Auto-Updater"


Second option to uncheck "Notify of plugin updates at startup" in Plugin Manager.


Enjoy!

OTRS - move ticket in another queue and reopen it


I wrote already how to disable to move closed tickets. Oppositely sometimes you need to move ticket in another department (queue) and change state to open (reopen), but by default OTRS keeps current state.

Simplest way to search in SysConfig for AgentTicketMove and edit Frontend::Agent::Ticket::ViewMove

Ticket::Frontend::MoveType => NewWindow

Ticket::Frontend::AgentTicketMove###State => Yes



Then combo box will be replaced with menu item "Change Queue" and will appears popup window.


Enjoy!

Wordpad++ download

Q: Где скачать бесплатно wordpad++
A: Загрузить

PS: wordpad++ это не notepad++ !!!

Notepad++: a free source code editor which supports several programming languages running under the MS Windows environment. Download

HOWTO: Repair Logitech M325 Mouse

FixIt says that you will find single screw under CE label. It isn't always true.