MachineInfo GitHub

by GarciaPL on Wednesday, 26 December 2012


I would like to introduce my new repo on GitHub which is called MachineInfo. More information after clicking the link below :

https://pastebin.com/aefQhyTj

Bad interpreter: No such file or directory PHP

by GarciaPL on Friday, 14 December 2012


I used to write some scripts in PHP which i was going to run on Linux. Unfortunately, I was faced with this small error :

Bad interpreter: No such file or directory

All you need to fix it is just run this command :

dos2unix /path/to/your/script.php


Reference :
[1] Fixing error bad interpreter cyprich.com

MySQL Find duplicate records

by GarciaPL on Wednesday, 5 December 2012


I used to find many times duplicates in my table in MySQL database this time. First of all, I will paste here my table structure below (yes i know that it is difficult to read) :

mysql> describe proxy_parser_statistics;
+-----------------------+---------+------+-----+---------+----------------+
| Field                 | Type    | Null | Key | Default | Extra          |
+-----------------------+---------+------+-----+---------+----------------+
| ID                    | int(11) | NO   | PRI | NULL    | auto_increment |
| file_name             | text    | NO   |     | NULL    |                |
| processing_stamp_date | date    | YES  |     | NULL    |                |
| processing_stamp_time | time    | YES  |     | NULL    |                |
| processed_records     | int(11) | YES  |     | NULL    |                |
+-----------------------+---------+------+-----+---------+----------------+

I just use this query :

SELECT a.id, a.file_name FROM proxy_parser_statistics a INNER JOIN proxy_parser_statistics b ON a.file_name = b.file_name WHERE a.id <> b.id

Results of above query :

+-----+-----------------------------+
| id  | file_name                   |
+-----+-----------------------------+
| 803 | access1211170012.merged.log |
| 804 | access1211170112.merged.log |
| 805 | access1211170212.merged.log |
| 806 | access1211170312.merged.log |
| 807 | access1211170412.merged.log |
| 808 | access1211170512.merged.log |
| 809 | access1211170612.merged.log |
| 810 | access1211170712.merged.log |
| 811 | access1211170812.merged.log |
| 812 | access1211170912.merged.log |
| 813 | access1211171012.merged.log |
| 814 | access1211171112.merged.log |
| 815 | access1211171212.merged.log |
| 816 | access1211171312.merged.log |
| 817 | access1211171412.merged.log |
| 818 | access1211171512.merged.log |
| 819 | access1211171612.merged.log |
| 820 | access1211171712.merged.log |
| 821 | access1211171812.merged.log |
| 822 | access1211171912.merged.log |
| 823 | access1211172012.merged.log |
| 824 | access1211172112.merged.log |
| 825 | access1211172212.merged.log |
| 826 | access1211172312.merged.log |
| 827 | access1211172359.merged.log |
| 727 | access1211170012.merged.log |
| 728 | access1211170112.merged.log |
| 729 | access1211170212.merged.log |
| 730 | access1211170312.merged.log |
| 731 | access1211170412.merged.log |
| 732 | access1211170512.merged.log |
| 733 | access1211170612.merged.log |
| 734 | access1211170712.merged.log |
| 735 | access1211170812.merged.log |
| 736 | access1211170912.merged.log |
| 737 | access1211171012.merged.log |
| 738 | access1211171112.merged.log |
| 739 | access1211171212.merged.log |
| 740 | access1211171312.merged.log |
| 741 | access1211171412.merged.log |
| 742 | access1211171512.merged.log |
| 743 | access1211171612.merged.log |
| 744 | access1211171712.merged.log |
| 745 | access1211171812.merged.log |
| 746 | access1211171912.merged.log |
| 747 | access1211172012.merged.log |
| 748 | access1211172112.merged.log |
| 749 | access1211172212.merged.log |
| 750 | access1211172312.merged.log |
| 751 | access1211172359.merged.log |
+-----+-----------------------------+

Reference :
[1] Table structure Pastebin.com [2] Query result Pastebin.com

Crontab run job every hour

by GarciaPL on Wednesday, 21 November 2012

Hi, I would like to show you very quick and I hope so, quite useful advice, how to run some job in every hour using crontab :

0 * * * * /destination/to/your/script.pl


Enjoy!

OpenAPI Orange Plus T-Mobile and Play

by GarciaPL on Thursday, 15 November 2012


In recent time Institute of Communications (Instytut Łączności) began work on create a common API for telecom operators in Poland such a Orange, Plus, T-Mobile and Play to unificate using of their network functionality for instance sending and receiving SMS/MMS/USSD, make phone calls, phone localization etc.

I think that this work of Institute of Communications and major telecoms in Poland, will help developers and small companies to reduce costs associated with the need to adopt their services to telecom networks in Poland.



Reference :
[1] Institute of Communications (Instytut Łączności)
[2] Statement of Institute of Communications (pdf) [Polish]
[3] Statement of Institute of Communications (pdf) [English]
[4] Home page of OpenAPI initiative [English]

Ubuntu 12.04 Eclipse SWT lib

by GarciaPL on Wednesday, 24 October 2012


I have recently installed Eclipse using Ubuntu Software Center in Ubuntu 12.04 and when I run it I have below message in log :

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
no swt-gtk-3740 in java.library.path
no swt-gtk in java.library.pathCan't load library: /home/tom/.swt/lib/linux/x86_64/libswt-gtk-3740.so
Can't load library: /home/tom/.swt/lib/linux/x86_64/libswt-gtk.so

at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:695)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:153)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:95)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

So, fix of this problem is one of those lines which you should run in terminal :

For Ubuntu 12.04 32 bit :

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/

For Ubuntu 12.04 64-bit:

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/


Reference :
[1] Stackoverflow.com Eclipse cannot load SWT