Showing posts with label Ubuntu. Show all posts

GPG error: http://downloads.hipchat.com Public key is not available

by GarciaPL on Saturday, 6 February 2016

Recently I had an issue during installation of HipChat from Atlassian on my Ubuntu. I mean that installation went well, but I had issue with GPG keys which was :

"GPG error: http://downloads.hipchat.com stable InRelease: The following signatures couldn't be verified because the public key is not available"

So, I managed to find that WebUpd8Team provides tool called y-ppa-manager. All you have to do is install y-ppa-manager like below :

sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager

and then launch this tool. Select "Advanced" and then "Try to import all missing GPG keys". This operation might take a one or two minutes, so be calm and wait for notification. After that you can run sudo apt-get update to refresh repositories.



Reference : [1] Y PPA Manager - WebUpd8Team

SQL Developer Freezes on Ubuntu

by GarciaPL on Wednesday, 12 November 2014

Some of you have faced the problem when SQL Developer on Ubuntu which just freeze after some idle time. More information about this issue and solution can be found under [1]. I must to admit that this solution is quite complex, so I decided to prepare some very simple tool called SQLDeveloper Killer. Below I paste some source code in Java which aims to list all processes which are alive in system and find particular process which corresponds to SQL Developer process (contains "sqldeveloper.conf" in CMD description).

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package killsqldeveloper;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 *
 * @author lciesluk
 */
public class KillSQLDeveloper {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            Process exec = Runtime.getRuntime().exec(new String[]{"ps", "-ef"});
            exec.waitFor();

            BufferedReader reader
                    = new BufferedReader(new InputStreamReader(exec.getInputStream()));

            String line = "";
            while ((line = reader.readLine()) != null) {
                if (line.contains("sqldeveloper.conf")) {
                    System.out.println(line);
                    String[] split = line.split(" ");
                    if (split.length > 2) {
                        System.out.println(split[1]);
                        if (!split[1].equals("")) {
                            Process execKill = Runtime.getRuntime().exec(new String[]{"kill", "-9", split[1]});
                            execKill.waitFor();
                        } else {
                            Process execKill = Runtime.getRuntime().exec(new String[]{"kill", "-9", split[2]});
                            execKill.waitFor();
                        }
                    }
                    break;
                }
            }

        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}


After you paste this code to your IDE, you can install very useful tool called alacarte to create Unity launcher on Ubuntu.

SQL Developer Killer


Reference : [1] Alexeymoseyev.wordpress.com - Oracle SQL Developer hangs on Linux [2] Pastebin.com - Source Code [3] Alacarte - Ubuntu menu editor

Brother DCP-J152W setup scanner

by GarciaPL on Sunday, 14 September 2014

Printing some docs on Ubuntu using one of the printer delivered by Brother is quite easy. You just need to install appropriate packages (deb or rpm) and after that you can easily setup your Brother printer (in my case Brother DCP-J152W) connected via USB or WiFi due to future prints.

Linux user may deal with some problem when there is a need to use scanner built-in Brother device. Fortunately there is a solution of this problem. In this case Brother printer is connected to router byWiFi :

  1. Download and install those packages : brscan4, brscan-skey and brother-udev-rule.
  2. Check if you Brother model is available to configure - run command in terminal - brsaneconfig4 -q
  3. If you Brother model is on the list after perform previous step, then you can configure it - brsaneconfig4 -a name=DCPJ152W model=DCP-J152W ip=192.168.1.102
  4. Test if your Brother printer is available through the network - brsaneconfig4 -p. If your device is responding, you can go to the next step.
  5. Finally use tools like XSane or VueScan to scan your docs using Brother scanner.

Reference : [1] Support.brother.com - DCP-J152W Downloads [2] Support.brother.com - Scanner driver install for network [3] Unix.stackexchange.com - Brother DCP-J315W is active in terminal but not detected in Elementary OS [4] Secure.kitserve.org.uk - Ubuntu Brother Printer-Scanner Network Setup

SQL Developer

by GarciaPL on Thursday, 31 July 2014

If you have difficulties with running SQL Developer (in my case 4.0.2.15.21) from Oracle in console on Linux you can see such stack trace :

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007feb22ed8be0, pid=32116, tid=140649711318784
#
# JRE version: Java(TM) SE Runtime Environment (7.0_65-b17) (build 1.7.0_65-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  0x00007feb22ed8be0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/lukasz/sqldeveloper/sqldeveloper/bin/hs_err_pid32116.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#
/home/lukasz/sqldeveloper/sqldeveloper/bin/../../ide/bin/launcher.sh: line 1193: 32116 Przerwane               (core dumped) ${JAVA} "${APP_VM_OPTS[@]}" ${APP_ENV_VARS} -classpath ${APP_CLASSPATH} ${APP_MAIN_CLASS} "${APP_APP_OPTS[@]}"

So, fix of this problem is quite easy - go to file sqldeveloper.sh which is located in folder of your SQL Developer and add at the beginning of this file the following line :
unset GNOME_DESKTOP_SESSION_ID

SQLDeveloper.sh
SQLDeveloper.sh


Eclipse menu bug in Ubuntu

by GarciaPL on Saturday, 28 June 2014

Recently I had to deal with an error during using Eclipse on my Ubuntu 13.10. When I clicked in Eclipse on any menu item there was nothing showed up. As far as I know this error is related with Unity graphical shell created for GNOME. One of the fix which I found is to run Eclipse with some extra additional parameters. I also created some shell script which will help to enjoy again a menu features in Eclipse.


#!/bin/bash
#
# Run Eclipse due to menu bug
#
eclipsepath="/home/user/Desktop/eclipse/eclipse"
Exec=env UBUNTU_MENUPROXY=0 $eclipsepath

Of course in this script you must edit eclipsepath variable value to path which really guides to eclipse. You can run script in terminal using ./eclipse.sh, but before doing that you must give executable permission to script using this command chmod +x eclipse.sh.
Reference : [1] askubuntu.com Eclipse menus are cut off or dont show [2] stackoverflow.com Eclipse menus dont show up after upgrading to ubuntu 13.10 [3] Pastebin.com Source Code

FFmpeg Picture in Picture

by GarciaPL on Thursday, 29 May 2014

In this post you can find a small piece of code which should allows you to make picture in picture using ffmpeg. More information about this effect you can find in reference section of this post.

ffmpeg -i \tmp\stream1.mp4 -r 29.97 -vf "movie=\tmp\stream2.mp4, scale=212:120 [vid2]; [in][vid2] overlay=main_w-overlay_w-10:10 [out]" \tmp\output.mp4 &

I used ampersand at the end of this command because I would like to create a new process of merging those two input videos files in background. I also uploaded below some example how it should looks like in final. I pointed using red circle the video which was added using stream2.mp4 source. Do not hesitate to modify this command above. I'm sure that you will adapt it for your own purposes.

Picture in Picture using FFmpeg

Reference : [1] Picture-in-picture Wikipedia

Kill FFmpeg process smoothly

by GarciaPL on Thursday, 3 April 2014

Let's assume that you use FFmpeg distribution in your application. One of your function is for instance saving some HLS stream (HTTP Live Streaming) into file. I suppose you are using python subprocess module to create process in Linux OS to obtain this stream to your hard disk.

In normal way if you would like to stop saving this content using FFmpeg on your storage, you will just press 'q' button while you are in terminal. Due to this FFmpeg will be able to finish saving content and do not damage the file at the end.

There is some kind of problem if you would like to kill this FFmpeg process in smooth way without damaging the file while you do not have access to the terminal.

You can use below solution written in Python to kill this FFmpeg process from your application. Only input which you need to ensure is PID (Process IDentifier) which describes your  process. You can use below shell code in Linux :

ps -ef | grep ffmpeg | awk '{print $2}'

Once you know PID of your FFmpeg process just use this Python code :
import psutil
import os
import signal

pids = psutil.get_pid_list()

for pid in pids:
      if (pid == <your_PID>):
            os.kill(pid,signal.SIGINT)
One thing is worthy of attention. You suppose to use mainly signal.SIGINT while you invoke os.kill function, because of it simulates in FFmpeg case the user interrupt of this process (typically initiated by pressing Control-C) which allow to FFmpeg to end his work properly.

Reference : [1] Python.org Subprocess Docs [2] Thelightfromtheblackhole.blogspot.com Sending sighup signal to some external [3] Unix signal - SIGINT


FFmpeg parse video/audio bitrate

by GarciaPL on Tuesday, 25 March 2014

Have you ever thought how receive the bitrate of your video/audio file using ffmpeg in command line ? Before I will show you a solution of this problem I would like to paste below some example output of video file which can be obtained using ffmpeg :

ffmpeg version git-2013-10-30-94a80e3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct 30 2013 15:46:23 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu8)
  configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/luszcwoj/ffmpeg_build/lib --bindir=/home/luszcwoj/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 48.100 / 52. 48.100
  libavcodec     55. 39.100 / 55. 39.100
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'aquarium.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2013-09-08 23:38:41
  Duration: 00:00:03.44, start: 0.000000, bitrate: 3933 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc), 640x480 [SAR 1:1 DAR 4:3], 2250 kb/s, 29.70 fps, 29.67 tbr, 90k tbn, 30 tbc (default)
    Metadata:
      creation_time   : 2013-09-08 23:38:41
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s (default)
    Metadata:
      creation_time   : 2013-09-08 23:38:41
      handler_name    : SoundHandle


If you would like to get the bitrate just use this command :
ffmpeg -i aquarium.mp4 2>&1 | grep bitrate: | awk '{print $6}'

Reference : [1] FFmpeg Home Page

Python PyXML gcc problem

by GarciaPL on Sunday, 10 November 2013

I would like to give you some advice how to solve the problem which brought you here. So, I had a problem with installing on Ubuntu 12.04.3 LTS one of Python module called PyXML which can be used for XML Processing. I would like to give below a very very long description of error which I was faced with during the installation of PyXML.


python2.5 setup.py build
running build
running build_py
running build_ext
building '_xmlplus.parsers.pyexpat' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -fPIC -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=1234 
-DXML_CONTEXT_BYTES=1024 -DHAVE_MEMMOVE=1 -Iextensions/expat/lib 
-I/usr/include/python2.5 -c extensions/pyexpat.c -o 
build/temp.linux-i686-2.5/extensions/pyexpat.o
extensions/pyexpat.c:5:20: error: Python.h: No such file or directory
extensions/pyexpat.c:8:21: error: compile.h: No such file or directory
extensions/pyexpat.c:9:25: error: frameobject.h: No such file or directory
extensions/pyexpat.c:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:70: error: expected specifier-qualifier-list before 
‘PyObject_HEAD’
extensions/pyexpat.c:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘Xmlparsetype’
extensions/pyexpat.c:98: error: expected specifier-qualifier-list before 
‘PyCodeObject’
extensions/pyexpat.c:108: error: expected ‘)’ before ‘*’ token
extensions/pyexpat.c:123: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c: In function ‘have_handler’:
extensions/pyexpat.c:150: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:150: error: (Each undeclared identifier is reported 
only once
extensions/pyexpat.c:150: error: for each function it appears in.)
extensions/pyexpat.c:150: error: ‘handler’ undeclared (first use in this 
function)
extensions/pyexpat.c:150: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:154: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:201: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:214: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c: In function ‘flag_error’:
extensions/pyexpat.c:248: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:252: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:305: error: expected ‘)’ before ‘*’ token
extensions/pyexpat.c:332: error: expected ‘)’ before ‘*’ token
extensions/pyexpat.c:367: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:419: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c: In function ‘call_character_handler’:
extensions/pyexpat.c:444: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:444: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:445: error: ‘temp’ undeclared (first use in this 
function)
extensions/pyexpat.c:447: warning: implicit declaration of function 
‘PyTuple_New’
extensions/pyexpat.c:455: warning: implicit declaration of function 
‘conv_string_len_to_utf8’
extensions/pyexpat.c:458: warning: implicit declaration of function 
‘Py_DECREF’
extensions/pyexpat.c:462: warning: implicit declaration of function 
‘PyTuple_SET_ITEM’
extensions/pyexpat.c:464: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:465: warning: implicit declaration of function 
‘call_with_frame’
extensions/pyexpat.c:465: warning: implicit declaration of function 
‘getcode’
extensions/pyexpat.c:466: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:468: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘flush_character_buffer’:
extensions/pyexpat.c:482: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:482: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c:484: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:484: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c:485: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c: In function ‘my_CharacterDataHandler’:
extensions/pyexpat.c:493: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:496: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c:496: error: ‘xmlparseobject’ has no member named 
‘buffer_size’
extensions/pyexpat.c:505: error: ‘xmlparseobject’ has no member named 
‘buffer_size’
extensions/pyexpat.c:507: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c:510: warning: implicit declaration of function ‘memcpy’
extensions/pyexpat.c:510: warning: incompatible implicit declaration of 
built-in function ‘memcpy’
extensions/pyexpat.c:510: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:510: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c:512: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c: In function ‘my_StartElementHandler’:
extensions/pyexpat.c:524: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:524: error: ‘container’ undeclared (first use in 
this function)
extensions/pyexpat.c:524: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:524: warning: left-hand operand of comma expression 
has no effect
extensions/pyexpat.c:524: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:524: warning: left-hand operand of comma expression 
has no effect
extensions/pyexpat.c:532: error: ‘xmlparseobject’ has no member named 
‘specified_attributes’
extensions/pyexpat.c:533: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c:541: error: ‘xmlparseobject’ has no member named 
‘ordered_attributes’
extensions/pyexpat.c:542: warning: implicit declaration of function 
‘PyList_New’
extensions/pyexpat.c:544: warning: implicit declaration of function 
‘PyDict_New’
extensions/pyexpat.c:550: error: ‘n’ undeclared (first use in this function)
extensions/pyexpat.c:550: warning: implicit declaration of function 
‘string_intern’
extensions/pyexpat.c:551: error: ‘v’ undeclared (first use in this function)
extensions/pyexpat.c:557: warning: implicit declaration of function 
‘conv_string_to_utf8’
extensions/pyexpat.c:564: error: ‘xmlparseobject’ has no member named 
‘ordered_attributes’
extensions/pyexpat.c:565: warning: implicit declaration of function 
‘PyList_SET_ITEM’
extensions/pyexpat.c:568: warning: implicit declaration of function 
‘PyDict_SetItem’
extensions/pyexpat.c:579: warning: implicit declaration of function 
‘Py_BuildValue’
extensions/pyexpat.c:585: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:587: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:588: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_EndElementHandler’:
extensions/pyexpat.c:636: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:636: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:636: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:636: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:636: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:636: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_ProcessingInstructionHandler’:
extensions/pyexpat.c:640: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:640: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:640: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:640: error: ‘conv_string_to_utf8’ undeclared (first 
use in this function)
extensions/pyexpat.c:640: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:640: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:640: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_UnparsedEntityDeclHandler’:
extensions/pyexpat.c:646: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:646: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:646: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:646: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:646: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:646: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_EntityDeclHandler’:
extensions/pyexpat.c:659: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:659: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:659: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:659: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:659: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:659: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_XmlDeclHandler’:
extensions/pyexpat.c:696: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:696: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:696: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:696: error: ‘conv_string_to_utf8’ undeclared (first 
use in this function)
extensions/pyexpat.c:696: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:696: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:696: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:705: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c: In function ‘my_ElementDeclHandler’:
extensions/pyexpat.c:737: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:737: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:740: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:741: error: ‘modelobj’ undeclared (first use in 
this function)
extensions/pyexpat.c:741: error: ‘nameobj’ undeclared (first use in this 
function)
extensions/pyexpat.c:741: warning: left-hand operand of comma expression 
has no effect
extensions/pyexpat.c:751: warning: implicit declaration of function 
‘conv_content_model’
extensions/pyexpat.c:751: error: ‘conv_string_to_utf8’ undeclared (first 
use in this function)
extensions/pyexpat.c:769: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:771: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:772: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:780: warning: implicit declaration of function 
‘Py_XDECREF’
extensions/pyexpat.c:781: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c: In function ‘my_AttlistDeclHandler’:
extensions/pyexpat.c:785: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:785: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:785: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:785: error: ‘conv_string_to_utf8’ undeclared (first 
use in this function)
extensions/pyexpat.c:785: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:785: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:785: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_SkippedEntityHandler’:
extensions/pyexpat.c:798: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:798: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:798: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:798: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:798: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:798: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_NotationDeclHandler’:
extensions/pyexpat.c:806: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:806: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:806: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:806: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:806: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:806: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_StartNamespaceDeclHandler’:
extensions/pyexpat.c:816: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:816: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:816: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:816: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:816: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:816: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_EndNamespaceDeclHandler’:
extensions/pyexpat.c:823: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:823: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:823: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:823: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:823: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:823: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_CommentHandler’:
extensions/pyexpat.c:828: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:828: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:828: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:828: error: ‘conv_string_to_utf8’ undeclared (first 
use in this function)
extensions/pyexpat.c:828: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:828: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:828: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_StartCdataSectionHandler’:
extensions/pyexpat.c:832: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:832: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:832: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:832: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:832: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:832: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_EndCdataSectionHandler’:
extensions/pyexpat.c:836: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:836: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:836: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:836: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:836: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:836: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_DefaultHandler’:
extensions/pyexpat.c:841: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:841: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:841: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:841: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:841: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:841: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_DefaultHandlerExpandHandler’:
extensions/pyexpat.c:845: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:845: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:845: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:845: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:845: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:845: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_NotStandaloneHandler’:
extensions/pyexpat.c:862: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:862: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:862: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:862: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:862: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:862: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:862: warning: implicit declaration of function 
‘PyInt_AsLong’
extensions/pyexpat.c: In function ‘my_ExternalEntityRefHandler’:
extensions/pyexpat.c:866: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:866: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:866: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:866: error: ‘conv_string_to_utf8’ undeclared (first 
use in this function)
extensions/pyexpat.c:866: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:866: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:866: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_StartDoctypeDeclHandler’:
extensions/pyexpat.c:881: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:881: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:881: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:881: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:881: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:881: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: In function ‘my_EndDoctypeDeclHandler’:
extensions/pyexpat.c:889: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:889: error: ‘args’ undeclared (first use in this 
function)
extensions/pyexpat.c:889: error: ‘rv’ undeclared (first use in this 
function)
extensions/pyexpat.c:889: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c:889: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:889: error: ‘xmlparseobject’ has no member named 
‘in_callback’
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:893: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:912: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:930: error: expected declaration specifiers or 
‘...’ before ‘PyObject’
extensions/pyexpat.c: In function ‘readinst’:
extensions/pyexpat.c:932: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:932: error: ‘arg’ undeclared (first use in this 
function)
extensions/pyexpat.c:933: error: ‘bytes’ undeclared (first use in this 
function)
extensions/pyexpat.c:934: error: ‘str’ undeclared (first use in this 
function)
extensions/pyexpat.c:937: warning: implicit declaration of function 
‘PyInt_FromLong’
extensions/pyexpat.c:948: warning: implicit declaration of function 
‘PyObject_CallObject’
extensions/pyexpat.c:948: error: ‘meth’ undeclared (first use in this 
function)
extensions/pyexpat.c:956: warning: implicit declaration of function 
‘PyString_Check’
extensions/pyexpat.c:957: warning: implicit declaration of function 
‘PyErr_Format’
extensions/pyexpat.c:957: error: ‘PyExc_TypeError’ undeclared (first use 
in this function)
extensions/pyexpat.c:962: warning: implicit declaration of function 
‘PyString_GET_SIZE’
extensions/pyexpat.c:964: error: ‘PyExc_ValueError’ undeclared (first 
use in this function)
extensions/pyexpat.c:970: warning: incompatible implicit declaration of 
built-in function ‘memcpy’
extensions/pyexpat.c:970: warning: implicit declaration of function 
‘PyString_AsString’
extensions/pyexpat.c:970: warning: passing argument 2 of ‘memcpy’ makes 
pointer from integer without a cast
extensions/pyexpat.c:970: note: expected ‘const void *’ but argument is 
of type ‘int’
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:981: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1044: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1062: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1077: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1108: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1203: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1223: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1242: error: array type has incomplete element type
extensions/pyexpat.c:1243: error: ‘PyCFunction’ undeclared here (not in 
a function)
extensions/pyexpat.c:1243: error: expected ‘}’ before ‘xmlparse_Parse’
extensions/pyexpat.c:1245: error: expected ‘}’ before ‘xmlparse_ParseFile’
extensions/pyexpat.c:1247: error: expected ‘}’ before ‘xmlparse_SetBase’
extensions/pyexpat.c:1249: error: expected ‘}’ before ‘xmlparse_GetBase’
extensions/pyexpat.c:1251: error: expected ‘}’ before 
‘xmlparse_ExternalEntityParserCreate’
extensions/pyexpat.c:1253: error: expected ‘}’ before 
‘xmlparse_SetParamEntityParsing’
extensions/pyexpat.c:1255: error: expected ‘}’ before 
‘xmlparse_GetInputContext’
extensions/pyexpat.c:1258: error: expected ‘}’ before 
‘xmlparse_UseForeignDTD’
extensions/pyexpat.c:1320: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c: In function ‘xmlparse_dealloc’:
extensions/pyexpat.c:1395: warning: implicit declaration of function 
‘PyObject_GC_Fini’
extensions/pyexpat.c:1397: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c:1398: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c:1399: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c:1401: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:1402: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:1402: error: ‘temp’ undeclared (first use in this 
function)
extensions/pyexpat.c:1404: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:1405: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:1408: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:1409: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:1411: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1412: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1413: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1415: error: ‘xmlparseobject’ has no member named 
‘intern’
extensions/pyexpat.c:1418: warning: implicit declaration of function 
‘PyObject_Del’
extensions/pyexpat.c: In function ‘handlername2int’:
extensions/pyexpat.c:1430: warning: implicit declaration of function 
‘strcmp’
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:1437: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1445: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1549: error: expected declaration specifiers or 
‘...’ before ‘PyObject’
extensions/pyexpat.c: In function ‘sethandler’:
extensions/pyexpat.c:1554: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:1554: error: ‘temp’ undeclared (first use in this 
function)
extensions/pyexpat.c:1554: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:1556: error: ‘v’ undeclared (first use in this 
function)
extensions/pyexpat.c:1556: error: ‘Py_None’ undeclared (first use in 
this function)
extensions/pyexpat.c:1559: warning: implicit declaration of function 
‘Py_INCREF’
extensions/pyexpat.c:1562: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:1564: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:1571: error: expected declaration specifiers or 
‘...’ before ‘PyObject’
extensions/pyexpat.c: In function ‘xmlparse_setattr’:
extensions/pyexpat.c:1574: error: ‘v’ undeclared (first use in this 
function)
extensions/pyexpat.c:1575: warning: implicit declaration of function 
‘PyErr_SetString’
extensions/pyexpat.c:1575: error: ‘PyExc_RuntimeError’ undeclared (first 
use in this function)
extensions/pyexpat.c:1579: warning: implicit declaration of function 
‘PyObject_IsTrue’
extensions/pyexpat.c:1580: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1581: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1581: error: ‘xmlparseobject’ has no member named 
‘buffer_size’
extensions/pyexpat.c:1582: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1583: warning: implicit declaration of function 
‘PyErr_NoMemory’
extensions/pyexpat.c:1586: error: ‘xmlparseobject’ has no member named 
‘buffer_used’
extensions/pyexpat.c:1589: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1592: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1593: error: ‘xmlparseobject’ has no member named 
‘buffer’
extensions/pyexpat.c:1599: error: ‘xmlparseobject’ has no member named 
‘ns_prefixes’
extensions/pyexpat.c:1601: error: ‘xmlparseobject’ has no member named 
‘ns_prefixes’
extensions/pyexpat.c:1602: error: ‘xmlparseobject’ has no member named 
‘itself’
extensions/pyexpat.c:1602: error: ‘xmlparseobject’ has no member named 
‘ns_prefixes’
extensions/pyexpat.c:1607: error: ‘xmlparseobject’ has no member named 
‘ordered_attributes’
extensions/pyexpat.c:1609: error: ‘xmlparseobject’ has no member named 
‘ordered_attributes’
extensions/pyexpat.c:1615: error: ‘PyExc_ValueError’ undeclared (first 
use in this function)
extensions/pyexpat.c:1623: error: ‘xmlparseobject’ has no member named 
‘returns_unicode’
extensions/pyexpat.c:1628: error: ‘xmlparseobject’ has no member named 
‘specified_attributes’
extensions/pyexpat.c:1630: error: ‘xmlparseobject’ has no member named 
‘specified_attributes’
extensions/pyexpat.c:1642: error: too many arguments to function 
‘sethandler’
extensions/pyexpat.c:1645: error: ‘PyExc_AttributeError’ undeclared 
(first use in this function)
extensions/pyexpat.c: At top level:
extensions/pyexpat.c:1676: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘Xmlparsetype’
extensions/pyexpat.c:1719: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1766: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c:1778: error: array type has incomplete element type
extensions/pyexpat.c:1779: error: expected ‘}’ before ‘pyexpat_ParserCreate’
extensions/pyexpat.c:1781: error: expected ‘}’ before ‘pyexpat_ErrorString’
extensions/pyexpat.c:1797: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘*’ token
extensions/pyexpat.c: In function ‘initpyexpat’:
extensions/pyexpat.c:1835: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:1835: error: ‘m’ undeclared (first use in this 
function)
extensions/pyexpat.c:1835: error: ‘d’ undeclared (first use in this 
function)
extensions/pyexpat.c:1835: warning: left-hand operand of comma 
expression has no effect
extensions/pyexpat.c:1836: error: ‘errmod_name’ undeclared (first use in 
this function)
extensions/pyexpat.c:1836: warning: implicit declaration of function 
‘PyString_FromString’
extensions/pyexpat.c:1837: error: ‘errors_module’ undeclared (first use 
in this function)
extensions/pyexpat.c:1838: error: ‘modelmod_name’ undeclared (first use 
in this function)
extensions/pyexpat.c:1839: error: ‘model_module’ undeclared (first use 
in this function)
extensions/pyexpat.c:1840: error: ‘sys_modules’ undeclared (first use in 
this function)
extensions/pyexpat.c:1848: error: ‘Xmlparsetype’ undeclared (first use 
in this function)
extensions/pyexpat.c:1848: error: ‘PyType_Type’ undeclared (first use in 
this function)
extensions/pyexpat.c:1851: warning: implicit declaration of function 
‘Py_InitModule3’
extensions/pyexpat.c:1855: error: ‘ErrorObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:1856: warning: implicit declaration of function 
‘PyErr_NewException’
extensions/pyexpat.c:1862: warning: implicit declaration of function 
‘PyModule_AddObject’
extensions/pyexpat.c:1866: error: expected expression before ‘)’ token
extensions/pyexpat.c:1868: warning: implicit declaration of function 
‘get_version_string’
extensions/pyexpat.c:1869: warning: implicit declaration of function 
‘PyModule_AddStringConstant’
extensions/pyexpat.c:1889: warning: implicit declaration of function 
‘PySys_GetObject’
extensions/pyexpat.c:1890: warning: implicit declaration of function 
‘PyModule_GetDict’
extensions/pyexpat.c:1891: warning: implicit declaration of function 
‘PyDict_GetItem’
extensions/pyexpat.c:1893: warning: implicit declaration of function 
‘PyModule_New’
extensions/pyexpat.c:1918: error: ‘list’ undeclared (first use in this 
function)
extensions/pyexpat.c:1921: warning: implicit declaration of function 
‘PyErr_Clear’
extensions/pyexpat.c:1926: error: ‘item’ undeclared (first use in this 
function)
extensions/pyexpat.c:1933: warning: implicit declaration of function 
‘PyList_Append’
extensions/pyexpat.c:1996: warning: implicit declaration of function 
‘PyModule_AddIntConstant’
extensions/pyexpat.c: In function ‘clear_handlers’:
extensions/pyexpat.c:2023: error: ‘PyObject’ undeclared (first use in 
this function)
extensions/pyexpat.c:2023: error: ‘temp’ undeclared (first use in this 
function)
extensions/pyexpat.c:2027: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:2029: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:2030: error: ‘xmlparseobject’ has no member named 
‘handlers’
extensions/pyexpat.c:2032: error: ‘xmlparseobject’ has no member named 
‘itself’
error: command 'gcc' failed with exit status 1


Quite enormous, isn't it ? :) So, fix of this problem is very easy - just install python-dev package in Ubuntu. You can use this command in your terminal :

sudo apt-get install python-dev


Reference : [1] Gmane.org XML Processing [2] PyXML Home Page Project

MySQL Refresh processlist every second

by GarciaPL on Wednesday, 9 October 2013

Very useful piece of command line query which will help you to keep an eye on execution time of queries which are performed in your MySQL database. It helps me when I ask myself : 'Hm ... I am wondering if this query is now executed ... '. This question can be sometime annoying, so this is quite helpful adoption of mysqladmin tool.

mysqladmin -u root -p -i 1 processlist

-u your username
-p you be pleased to give database password
-i 1 interval which equals 1 second


Example output :

+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host      | db | Command | Time | State | Info             |
+----+------+-----------+----+---------+------+-------+------------------+
| 43 | root | localhost |    | Query   | 0    |       | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+

Reference : [1] Mysqladmin Tool Doc

Killing processes contain pattern

by GarciaPL on Saturday, 10 August 2013

I would like to share, in my opinion, quite helpful tool dedicated for Linux administrators for ending (or some of you would say "killing") processes which contain particular pattern. I prepared a dedicated script written in Perl which is very easy to help. If you would like to kill all processes contain word "chrome" just run like this one : ./KillProcesses.pl -p chrome. I also wrote a small program with infinity loop which can be used for testing purposes. It can be found using pattern LoopProcess.

KillProcesses.pl

#!/usr/bin/perl -w

use strict;
use warnings;
use Getopt::Long;
use Data::Dumper;

my $help;
my $process_pattern = undef;

sub kill_processes {
 if (defined($process_pattern)) {
  my @processeslist = `ps -ef | grep $process_pattern | grep -v grep | awk '{print \$2}'`;

  if ((@processeslist) and (scalar(@processeslist) > 1)) {
   print "\nKilling processes with PID like : \n";
   print @processeslist;
   my @killprocess = `kill -9 @processeslist`;
   print Dumper @killprocess;
  } else {
   print "\nCan not find processes contain a pattern '$process_pattern'\n";
  }
 } else {
  print "\nProcess name was not defined\n";
 }
}

sub usage {
    print "$0 -p \n";
}

sub help {
   print "\nKill All Processes along with pattern\n";
   usage();
   print < \$help,
  'p=s'  => \$process_pattern,   'pattern=s' => \$process_pattern
    );

if ($help) { help(); exit; }
if (!defined($process_pattern))
    { print "Put pattern of process! (-h for help)\n"; usage(); exit;}
}

######### MAIN PROGRAM

check_input();

######## KILL PROCESSES ALONG WITH PATTERN
print "\nSearching and ending processes contain a pattern '$process_pattern'";
kill_processes();


LoopProcess.pl

#!/usr/bin/perl -w

use strict;
use warnings;

while (1) {

}


Reference :  [1] GarciaPL Pastebin KillProcesses [2] GarciaPL Pastebin LoopProcess

Send mail in Perl

by GarciaPL on Sunday, 7 July 2013

I would like to share with you a small script written in Perl which simply send an email. You can use it in your other scripts when you want to indicate an error while something goes wrong. Of course this small piece of code can be also used in Nagios scripts ;) Only imagination is the limit where this sending email function can be used.

sub sendEmail {
        my ($to, $from, $subject, $message) = @_;
        my $sendmail = '/usr/lib/sendmail';
        open(MAIL, "|$sendmail -oi -t");
        print MAIL "From: $from\n";
        print MAIL "To: $to\n";
        print MAIL "Subject: $subject\n\n";
        print MAIL "$message\n";
        close(MAIL);
}
 
sendEmail("receiveremail\@domain.com", "myemail\@domain.com", "Nagios Error", "Cannot receive NRPE output from host 10.100.5.6");

Reference : 
[1] Pastebin GarciaPL Send email in Perl

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

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!

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