Archive

Archive for September, 2013

Create and start VirtualBox VM from command-line

September 28, 2013 Leave a comment

http://xmodulo.com/2013/05/how-to-create-and-start-virtualbox-vm-without-gui.html

Advertisements
Categories: ubuntu Tags:

Securing an Ubuntu server

September 26, 2013 Leave a comment
Categories: ubuntu Tags:

ssh

September 26, 2013 Leave a comment

Some notes about ssh

Install the sshd server:

sudo apt-get install openssh-server

Server start/stop/status/restart:

sudo service ssh {start|stop|status|restart}

Server config file:

/etc/ssh/sshd_config    # make a backup first

Here you can change the port (which is a good idea), disable PermitRootLogin, etc. You can also add these two lines to the end:

UseDNS no
AllowUsers USERNAME

Where USERNAME is the username of the user who can log in. Only (s)he can log in, nobody else.

Log in to a non-standard port:

ssh username@host -p PORT
Categories: ubuntu Tags:

HTML: add syntax-highlight to textarea

September 26, 2013 1 comment

Problem
You have an HTML form with a textarea where you want to accept some source code. You want to turn this simple textarea into a fancy input area that adds syntax highlighting.

Solution
I tried EditArea, and it suits my needs. See this SO page for more alternatives.

EditArea

EditArea is a free javascript editor for source code. This editor is designed to edit souce code files in a textarea. The main goal is to allow text formatting, search and replace and real-time syntax highlight (for not too heavy text).” (source)

For Python support, I had to add these lines to the HTML source:

<script language="javascript" type="text/javascript" src="../editarea/edit_area/edit_area_full.js"></script>
<script language="javascript" type="text/javascript">
editAreaLoader.init({
    id : "src_input"       // textarea id
    ,syntax: "css"          // syntax to be uses for highgliting
    ,start_highlight: true      // to display with highlight mode on start-up
    ,syntax: "python"
    ,replace_tab_by_spaces: 4
});
</script>

Related work

  • Ace (it seems a more professional solution)

Ubuntu: disable Alt to launch HUD

September 26, 2013 Leave a comment

Problem
In Ubuntu (with Unity), Alt launches the HUD. Fine. However, if you have a Windows in VirtualBox and you want to switch windows in the guest VM with Alt+TAB, that damn HUD always appears in the host. How to disable it?

Solution
I found the solution here.

In short: top right corner, System settings… -> Keyboard -> Shortcuts tab -> Launchers. Assign a new key to “Key to show the HUD“, or disable it completely by pressing the Backspace.

Categories: ubuntu, windows Tags: , , , ,

mkdir && cd

September 24, 2013 Leave a comment

Frustration
Has it ever happened to you?

$ mkdir something
$ cd something

Damn, that’s 2 commands. How to simplify it?

Solution

$ pwd
/home/jabba
$ mdgo something    # mdgo stands for: mkdir-go
$ pwd
/home/jabba/something

That is, the command “mdgo” creates a directory and enters in it. An alternative name could be “mdcd“.

If you want this alias, add the following lines to your ~/.bashrc:

mkdir_go()
{
if [[ -z "$1" ]]
then
    echo "Usage: mdgo <dir>"
else
    mkdir $1; cd $1
fi
}
alias mdgo=mkdir_go
Categories: bash Tags: ,

GyerekTV.hu [hu]

September 24, 2013 Leave a comment

This post is written in Hungarian.


A GyerekTV.hu azzal a céllal jött létre, hogy a gyerkőcök olyan meséket is láthassanak a weben, amiket a tv nem közvetít. Főleg a régebbi, klasszikus meséket helyezzük középpontba. Véleményünk szerint amíg a gyerekek ezen az oldalon nézik a jobbnál-jobb meséket, nem fognak a televízió előtt ülni és esetleg a nem nekik való műsorba futni.

Igyekszünk folyamatosan bővíteni a kínálatot!
Jelenleg 55 mesekategória és 1500+ meserész található oldalunkon!
” (source)

Ajánló

Categories: fun Tags: , ,