Αναζήτηση αυτού του ιστολογίου

Ταβερνες με παιδοτοπο - παιδική Χαρά (Αττική) & Kid-Friendly Εστιατόρια

6 σχόλια
1. Ταβέρνα του ΤΕΛΗ που βρίσκεται απέναντι από την μονή Πεντέλης (τηλ. 210 8040484)

2. Το ΣΤΕΚΙ ΤΟΥ ΑΝΔΡΕΑ, στα Σπάτα (Δημάρχου Χρ. Μπέκα 64, Σπάτα, τηλ.  210 6632059) που έχει παιδότοπο. Στέκι του Ανδρέα έχει κ στο Χαλάνδρι αλλά δεν είμαι σίγουρος ότι εκεί υπάρχει παιδότοπος...

3. www.anemomylos.com - (Χειμάρας 7, Ν. Ερυθραία. Τηλ. 210-8070969)
Πρόσβαση απο την εθνική οδό , έξοδο Βαρυμπόμπης.
Πολύ καλό. Πήγαμε 2 οικογένειες Ιούνιο 2014. Ανοιχτός μεγάλος χώρος, με παντού ίσκιο και είναι κατάλληλο ακόμα και για μεσημέρι. Υπάρχει μια μικρή παιδική χαρά για τα πιτσιρίκια. Φαγητό / service μια χαρά.

4.  Στο άλσος της Νέας Φιλαδέλφειας υπάρχει πίσω από τον Κένταυρο μια μικρή παιδική χαρά με τσουλήθρες και τεχνητο γκαζόν. Ακριβώς δίπλα τραπεζάκια για μας. Εννοείται ανοιχτός χώρος.

Computer Programming Exercises

0 σχόλια
PROGRAMMING EXERCISES FOR ANY LANGUAGE

1. Palindrome Detection
Create a simple algorith that will detect if a given string is a palindrome (read the same either when reading from left or right . For example radar , anna, etc).

Extend detection to palindrome phrases (i.e Lisa Bonet ate no basil, maps dna and spam, etc) . Ignore cases, spaces, etc.

The solution / code with less chars wins.

2. Palindrome Detection version 2 (by http://ittestsonline.com/ )
Write an algorithm which analyzes a string and checks if the characters can be rearranged to form a palindromic sequence.

If the string can indeed form a palindrome, also check if it can be transformed into a palindrome in maximum 3 rearrangements of characters – a rearrangement involves that a character changes its position with maximum 1 index, meaning only interchanges of adjacent characters are allowed at a time.

A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. There is no need to check for capital letters, diacritics, accents, spaces, punctuation or word dividers.

Input: String
Output: Boolean value - 0 for FALSE or 1 for TRUE if the 2 conditions are met.

Example:
For input "soososo" => output : TRUE (1 change) - soosoos

Extension:
If the word/string is not capable to be reverted in a palindrome with 3 rearrangments, but can be eventually a palindrome with more rearrangements , calculate how many rearrangments are necessary by respecting the rule of adjacent char interchange.
In this case provide Output like this:

Word Evaluation : Not a palindrome
Word Evaluation : Palindrome with 3 or less rearrangments
Word Evaluation : Palindrome with X rearrangments (define X)

Winner is the algorithm that can form a palindrome with the less rearrangments, and also with the less code.

PS: Some Programming Tools provide some built in functions that can reverse words , phrases, etc.
Some languages can also provide ready to use functions to check for palindromes.
The good thing is to built this shit from SCRATCH.

3. Linux Exercise
Built a simple local proxy redirector with netcat that will be able to receive data from your browser, will call the desired web address and send back the returned data from this web site to your browser.
Extend it to log the data also in a file .

OOP - Object Oriented Programming for Beginners

0 σχόλια
OOP For Old School Programmers
Just remember how we use to make programs in the old days, before OOP, using i.e Pascal.

We use to first create a section with declaration of variables/functions and then the main programm was started.

Programming for Beginners - Python at Linux

0 σχόλια
Intro:
This is a small guide/tutorial for someone who needs to start programming in linux.
What ever will be presented bellow is actually personal research which i upload here for two reasons:
1. Not to be forgotten by myself.
2. It might help other newbie users to start programming in Linux.

Disclaimer: If you decide to use code from this post or from the links that this post will redirect, you have to do it at your own responsibility.

Basics:
Supposingly that we do know some basic programming from school and commands like if-then-else or variable declaration are understood, we will try to examine what is the situation today will all those suites, IDE, GUI, and so on.

ELAN Touchscreen Right Click and Kernel Configuration

0 σχόλια
Trying to make Elan Touch Screen to work correctly on linux.
Target is to have a long press on the touch screen to be treated as a right click.
This fails in most DE. It is partially supported under Gnome and Unity.

Gnome Bug: Touchscreen right click works only if Dekstop Icons are hidden (=no desktop). If you enable the icons (classic desktop use) then right click fails to work.

This guy, tries to make ELAN to work correctly on an old kernel:
http://superuser.com/questions/729894/linux-kernel-getting-elan-touchscreen-to-work-usb-debug-related

As a solution he found this kernel configuration about config options
http://www.everfall.com/paste/id.php?pmj1v6mwhaly

Relevant Bugs: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1212736

Users suggest also to try mousetweaks (also available in Debian, but it is for Gnome)

Also there is this nice python script that is built for ELAN touchscreen and it might work:
https://github.com/Zyell/Python-Touchscreen-RightClick

Remote Desktop Connection on Linux with Debian 8.5

0 σχόλια
Target Set up : Debian 8.5 Sid , 32 bit , LXDE, Teamviewer installed.
Remote PC : Debian 8.5 Sid, 64bit, XFCE, Teamviewer NOT installed, vinagre client installed.

Option 1: Install TeamViewer in Remote PC.
This proved to be a head ache, since teamviewer installers (even the one that is supposed to be 64bit) are using 32bit libraries.

There is a debian wiki on how to install 32bit apps in 64bit systems (https://wiki.debian.org/Multiarch/HOWTO) by enabling multi-arch = multi architecture set up.

Also Check the corresponding section on this post : http://monaxoss.blogspot.gr/2016/07/installing-and-testing-debian.html

Installing Mate on Debian 8.5 from source

0 σχόλια
Debian 8,5 stable , supports Mate Desktop Environment 1.8
Debian 8.5 testing/unstable install Mate Environment 1.14

Mate 1.14 , cause Caja File Manager to crash with segmentation faults.
This behavior according to Mate Git was expected; Fortunatelly Debian moved quickly to version 1.16 whis is OK.

In case you still have Mate 1.14 and Caja keeps crashing , you will find how to upgrade/comple the latest Caja / Mate version bellow.

Oracle Virtual Box

0 σχόλια
Situation:
On a fresh VBox install (version 5.6.1 installed on Win7 host) and a fresh Debian Jessie Installation inside VBox (upgraded later to sid) , mouse was working perfectly both inside and ouside of the VBox without the need to use right click for mouse capture.

After installing guest addition tools in Debian (either by VB cd rom or via apt-get), mouse stopped working inside Debian, even with VB settings enabled for "mouse integration" (virtual machine top bar menu - input - click/check mouse integration).

Installing and Testing Debian on Old 32bit PCs

0 σχόλια
Two old 32bit PCs are available for testing:

One PC is a netbook HP Mini 210, equipped with 2 GB ram and Intel® Atom™ N455 single-core, 1.66-GHz processor.


Second PC is a 32bit 2GBram laptop by Toshiba.


Debian 8.5 + Cinammon,32 bit Live Image on HP Mini 210:

It was nice to see that after booting, debian offered two different boot options: Boot with non PAE support and boot with PAE supporting kernel.

Cinammon experience seems too heavy for this old netbook.
FireFox pageload or exploring the DE options was "stucking".
It has been noted that running FireFox blow up system resources.

I suppose if i try to combine Debian with a heavy DE like Gnome or KDE could lead to seriously limited performance.



Installing and Testing Debian 64bit UEFI

0 σχόλια
Debian Test 20/06/16 with UEFI Support on Toshiba Radius 11

I was looking for an easy way to try Debian amd64 in my Toshiba Radius 11 with UEFI.


For the time being , Debian provides amd64 Live Images, but those images do not support UEFI boot. Debian claims that this feature is under development.


Since Live images does not support UEFI, i thought to install debian using the debian amd64 netinstall image on a usb stick and selecting as disk drive for the installation another seperate usb disk of 8GB. Test was not succesfull.

Test Remarks:

1. First i have to mention that normal Debian 8 installation images trully support UEFI boot. 
This was initially obvious using rufus to make the bootable installation usb. 
If on Rufus you select "MBR for UEFI" instead of the standard "MBR for BIOS or UEFI", if selected iso image is not supporting UEFI, thankfully Rufus understands that and gives a warning message ; moreover Rufus doesn't proceed to format your usb.
You have either to select a UEFI enabled iso image or to change the rufus partition scheme option from "MBR for UEFI" to "MBR for BIOS or UEFI".


Using Debian for TouchScreen Laptops

0 σχόλια
As already said, UbuntuGnome 3.18 provides great support for 2in1 convertible laptops.

Considering to check you sys monitor in Ubuntu Gnome you will realize that UbuntuGnome consumes about 2Gb RAM in idle condition . 

As an alternative we could use Debian + XFCE or Debian + Mate, suitable modified to match the Toshiba Radius 11 convertible laptop with ELAN TouchScreen.



Light Linux for Old PCs

0 σχόλια
Old Laptop Setup : 32bit - Intel Dual Core + 2 GB RAM + Win 7 pre-installed.
The bug: After some heavy use all these years , it seems 2 GB is just not enough. Screen freezes 15 times per hour due to obvious luck of ram.

Mini Linux Distros 

A lot are said here, A lot of ultra-mini-linux-distros exist, but most of them seems to be based on Slackware which seems to be a version of OpenSuse.

http://www.techradar.com/news/software/operating-systems/10-of-the-most-popular-lightweight-linux-distros-1295034



Installing Linux/Ubuntu 16.04 on Toshiba Radius 11 "2in1" convertible laptop

0 σχόλια
To install Ubuntu together with win10 on Toshiba Radius 11 L10WC10C Convertible Laptop

Radius 11 L10W Specs: http://www.notebookcheck.net/Toshiba-Satellite-Radius-11-L10W-C-108-Notebook-Review.156893.0.html

PS: Youtube has a lot of tutorials for installing ubuntu as dual boot with Win10.
Download latest ISO image ubuntu release (LTS - Long Term Support) Follow instructions from ubuntu web site to make a live CD using Rufus software
Create a partition by windows disk manager (you have to shrink your main partition first in order to make space).

Leave the new partition unassigned - unformatted . Will be handled by Ubuntu Set up utility.

On the first live run, select the empty partition (manual installation of ubuntu - not automated like "Install ubuntu alongside with windows) and create a new small partition (press the + sign) of size equal to your ram (i.e 4 Gb) and select "swap" for this use.

Javascript & PHP Run Shell Commands

0 σχόλια
Execute Shell commands by browser.
http://superuser.com/questions/292818/run-a-shell-script-with-an-html-button
Javascript in browsers seems that is not allowing the executing of local scripts/commands in the client side due to obvious safety issues.
PS: Linux includes JavaScript as a stand alone application, to be run locally. In this case seems it is possible to execute shell commands.

On your browser, in server side, you can execute shell commands by JS but using PHP commands. This means that your machine / server should be set up and running PHP.

PS: There are some workarounds to run php locally without installing a full and complete web server but you have at least to install PHP (some how as a stand alone application).

In this server side case, you can call php commands by JS (call - run - exit php on the fly) like this within a JScript:

More PHP Scripts to run shell commands on your Apache server from your browser, using shell_exec or exec commands:

<?php
if (isset($_POST['shellexec']))
{
 $dirlist = shell_exec($_POST['command1']);
    echo '<pre>';
    #print_r($dirlist);
    echo htmlentities($dirlist); #echo works here well. Htmlentities work fine either you use ls -all, or cat file.html
    echo '</pre>';
    UNSET($_POST);
}

if (isset($_POST['exec2']))
{
 exec($_POST['command2'],$dirlist2,$retval);
    echo '<pre>';
 #print_r($dirlist2); #this works fine, but if you try to "cat" an html/php file , this is executedd on your browser...
 #moreover htmlentities doesn't work with print_r method (due to array).
    $result=print_r($dirlist2,true);
    #echo $dirlist2 -> echo doesn't work with arrays!
    echo htmlentities($result); #this works ok since you load print_r in $result variable.
    print_r($retval);
    echo '</pre>';
    unset ($_POST);
}

?>
<form action="" method="post">
    Command: <input type="text" name="command1" value="">
    <button type="submit" name="shellexec"> ShellExec </button>
   
</form>

<form action="" method="post">
    Command: <input type="text" name="command2" value="">
    <button type="submit" name="exec2">exec</button>
   
</form>

Tips:
You can run almost any freebsd command , depending on the permission rights.
for example :
ls -all , pwd, host , date, ifconfig, etc.
You can use cat filename to quickly display the contents of any server file in your browser
You can use cp or rm (copy or delete files) if you have the permission to do these actions.
You can combine commands in one line like "cd ..; pwd; ls -all".
Notice that when you reload the page, you are driven back to the directory that above script exists.

PS: Be carefull not to destroy your server...

PHP Built your own online php tester

0 σχόλια
I started this project at home, in order to be capable to play with PHP and Apache server from anywhere.
Set up : Apache 24 and PHP5.5

Target : To have one page on my browser with 2 frames. Left frame loads the content (html / php) of the file i select, right frame shows the html/php output.
I can change the code to the left and see the output on the right.

What it gets: You need 3 main files tstored in the directory of your web server.

PS: If you want you can create a seperate directory for testing , instead of default directory /usr/local/www/apache24/data. , but create a seperate directory inside /data (i.e phptest) so store all your files in usr/local/www/apache24/data/phptest

File 1 : main.html : This is the file that you will load from your browser like this:
http://iptoyourserver.com/apachedirectory/main.html
This file creates two frames in your browser. Left frame is used for editing the file , right frame for preview (actually running the file).
<html>
<frameset cols="50%,*">
<frame src="writefile.php" name="wfile" id="writecode">
<frame src="loadfile.php" name="rfile" id="runcode" >
</frameset>
</html>

File 2 : writefile.php :
This will be used on the left frame to open and save the file you want (supposed you already know the filenames in your apache server...)
<?php
session_start();
$host=gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo '<center> Welcome '. $_SERVER['REMOTE_ADDR'] . ' ('.$host. ') to my server </center>';
$date=shell_exec('date');
$person = "Connected: ".$_SERVER['REMOTE_ADDR']." (".$host.") @ ".$date." \n";
$handlelog=fopen('logfile.txt', 'a');fwrite($handlelog, $person);fclose($handlelog);

if (isset($_POST))
{
 if ($_POST['savefile']=="SaveFile")
 {
  $File = $_POST['filename']; 
  $Handle = fopen($File, 'w');
     $Data = $_POST['data'];
     if(get_magic_quotes_gpc())
    {$Data = stripslashes($Data);}  
#Some servers have "magic quotes" enabled, meaning that quotes are automatically typed as slash and
#quote. If magic quotes are on i strip the slashes.
     fwrite($Handle, $Data);
     print "Data Written";
  fclose($Handle);
  $_SESSION['fname']=$_POST['filename']; #pass filename to session global php enviroments
  $date=shell_exec('date');$action = "Saved File: " . $File . " @ ". $date ." \n"; #logging
  $handlelog=fopen('logfile.txt', 'a');fwrite($handlelog, $action);fclose($handlelog); #logging
  $FileData = file_get_contents($File); #read the just saved file.
 }
 if ($_POST['openfile']=="OpenFile")
 {
  $File = $_POST['filename'];
  $FileData = file_get_contents($File);
  $_SESSION['fname']=$_POST['filename']; #pass the filename in the global session php variable
  $date=shell_exec('date');$action = "Opened File: " . $File . " @ ". $date ." \n"; #logging
  $handlelog=fopen('logfile.txt', 'a');fwrite($handlelog, $action);fclose($handlelog); #logging
 }
}
?>
<form method="post" action="">
<td>
<textarea style="width:100%;height:50%" name="data" ><?php  echo htmlentities($FileData);?></textarea>
</td>
<!-- If you don't use the htmlentities html code (or even php) is executed on your browser with echo command -->
<br>
 <input type="text" name="filename" value=<?php echo $File;?> >
 <input type="submit" name="openfile" value="OpenFile">
 <input type="submit" name="savefile" value="SaveFile">
</form>
<script type="text/javascript">
parent.document.getElementById("runcode").contentWindow.location.reload();
  <!-- this small javascript updates the right frame using the frame id applied by main.html -->
</script>

PS: A small connection/activities loging is made by this file for my personal reasons.

File 3: loadfile.php : This will be the file that will load on the right frame the file selected (open or save) on the left frame.
<?php
session_start();
$file=$_SESSION['fname'];
echo '<center>File:'.$file.'</center>';
include $file;
?>

Notice here that this file uses the php include together with session filename variable passed by writefile.php to include (and finally run) the file you opened/modified with writefile.php.
Ofcourse the file specified must exist in your apache24 directory and must be a valid html or php page.

Tips / How to:
- Provide read - write permissions to each file you need to remotely edit and change.
- If moreover you provide read - write permission to the whole directory, you will be able to open and save even new files.
- If file handled by writefile.php is not an html/php file but a single text file, then your browser will just display on the right the contents of the text file.
- I use geany on FreeBSD for html / php files editing, since geany compiles/check the files i type for synthax errors (i.e missing ; and many more).
- For sure you can call writefile.php and loadfile.php seperately.
- You can even install these three files to the public directory of your web hosting provider to provide "on the fly" file management (open and save file) by avoiding to get connected all the normal way (web hoster control panel / files management / etc). I'm sure you can identify the security risks if you do so....