Syndicate content

Unix

An Operating System that works. All the specifications are free and Linux, AIX, HP-UX, SunOS, Solaris, IRIX are examples of a Unix implementation.

Attack by ZmEu

Who is ZmEu?

An image showing ZmeuThe name Zmeu (no capital E) is the name of a fantastic creature of Romania. There are so many stories that there isn't a clear understanding of what it is... but it is human like, can spit fire and wants to marry young women.

If you're wondering, it is generally a bad guy.

ZmEu Attack

Today, I noticed a lot of traffic on one of my servers. Looking into what was happening, I immediately found out that an attacker was looking for a loophole in that system. That attack was being performed from China.

Adding a group for to a logged in Linux user

Once in a while I want to add my user to a group and then right away make use of that group.

Unfortunately, in general Unix kind of forces you to re-log in for the new group to be attached to your account.

However, a command has been added, a while back, to do just that on the fly. Not something you would want to use in a script, but at least, it works for me when doing a few things here and there.

In my case, I wanted to run QEMU, which I hadn't done in a while, and the system told me that it could not open the KVM, the error: kvm permission denied.

The problem was that I was not part ...

The for() in C, C++, Java, PHP, JavaScript...

As I am working on my as2js compiler, I stumble on a couple of problems with the for() loop parsing because of the in keyword. That made me think and the for() statement was actually a very funny one. Yes! You can actually write something like this and it compiles:

int zero;
for(3;2;1) zero;

As you can see, all 3 entries in the for() statement are valid expressions and therefore the compiler can compile that code. This creates a loop that runs forever, similar to:

for(;;) zero;

but much less clear to read, obviously.

Now that's food for thought, isn't it?

In JavaScript, you ...

List ciphers currently used by Apache2

If you are using Apache and e-Commerce, you probably want to know all the details of the ciphers used by the Apache SSL module.

So listing Apache supported ciphers is done using nmap as follow:

nmap --script ssl-cert,ssl-enum-ciphers -p 443 secure.m2osw.com

This call gives you a complete list of all the ciphers currently accepted by your running version of Apache. For example, the list may look like this:

| ssl-enum-ciphers:
|   SSLv3:
|     ciphers:
|       TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
|       ...

When I lose the Gnome settings...

Now a day, I very often lose my Gnome settings. Most of it, I couldn't care less, but a few things are very important, especially the way my windows work: I HATE it when a window comes to the front when clicked on. It is totally crazy to work that way. Gnome supports the normal X11 way but they don't use that as the default, which is sad.

So I wrote a little script in order to be able to reset my settings without having to open CCSM (the Gnome preference tool) although if you have a hard time finding what you are looking for, CCSM can be useful!

There is my current script that fixes ...

Repair a Cassandra Cluster

I use the Cassandra database cluster system to manage a new set of websites and once in a while I start getting many errors and the website stops working altogether.

When that happens, it is likely that Cassandra broke something in the temporary tables that it holds. The only way to go past that problem is to clear those tables. Until then, it will fail over and over again (they really would need some euristic to auto-clean up even if it means that you're losing some data.)

The command to repair the database, really quick, is as follow:

nodetool scrub snap_websites files

Note that ...

Creating a new git repository

As I am now using git, I like to create my own repositories. In most cases the documentation is not that easy to follow. Here are the instructions I use:

Assuming you have a place such as /repo where you place all your CVS, SVN, and GIT repositories...

cd /repo
mkdir my-git
cd my-git
git init --bare
git update-server-info   # Only if you want to use via HTTP

Now we have a repository ready for use. Let's create a project and then add that project to the repository:

cd ~
mkdir my-project
cd my-project
[...create files, sub-directories, more files...]
cd ~/my-project
git ...

Bad move for PHP unpack()! So unpack() stopped working?

Today I noticed many errors on one of my websites. Looking closer into it, I noticed that the code for the mo_references Drupal module stopped working.

It took me some time, especially because the code seemed to work just fine as all the files could easily be displayed.

Actually, that was not the case. The unpack() character 'a', which I used, was transformed from a simple string that gets trimmed, to all the characters, including the NULL characters. Ouch! Now we have to use the 'Z' character instead.

I use it to unpack() a tar file by loading 512 bytes of data in a ...

#PCDATA and DTDs

If you are like me and write DTDs to check your XML files to make sure you don't have too many mistakes in them, then you probably have had this problem before.

The #PCDATA has a very special behavior and it is really restrained as follow:

  • #PCDATA must appear at the start
  • #PCDATA must be repeated from zero to infinity, so only * work with it
  • #PCDATA cannot be used with sub-groups (things between parenthesis)

Some like this:

<!ELEMENT Z (P | (#PCDATA | A | B | C)* | Q)+>

does not work because you use + and #PCDATA is within a sub-group.

What you need to do ...

Why would Redirect and RedirectMatch in Apache2 not work?

As we are working on a new website, we had a problem where a redirect would not work. I tried both: a simple Redirect and a RedirectMatch as follow:

Redirect / http://finball.m2osw.com/
RedirectMatch permanent ^(.*)$ http://finball.m2osw.com$1

Both of these entries would not work at all.

I verified, to make sure, that the alias module was turned on. It was.

ls -l /var/apache2/mods-enabled

This did list the alias.conf and alias.load entries as expected.

So? What else?

Well... This was installed on a new server and we left the default entry in there:

ls -l ...
Syndicate content Syndicate content

     

Terms of Site Index

Find the page/content you are looking for with our index.

  • compiler
  • INTO

    An SQL keyword used right before the name of a table where data is to be inserted. It is used with the INSERT and the SELECT keywords.

  • server
  • trigger
  • warning