PocketMine Server on Debian

Prerequisites

  1. Install dependencies:
    
    
    sudo apt-get install perl gcc g++ make automake libtool autoconf m4
    
  2. Create a user for the PocketMine server:
    
    
    sudo adduser pocketmine
    

    Installation

Continue reading

Advertisements

Encapsulation C++

A common question among newer Object-Oriented Programmers is “Why should I use and prefer to use getter and setter methods for my objects variables when I can simply set them as public?” For example, let’s consider the trivial object below: Continue reading

Emacs on Windows 10 Anniversary Update

I have emacs 25rc1 on bash on windows running in daily production with mild performance sacrifice. I used to have two issue:

  • X11 windows won’t resize(both emacs and emacs-snapshot).
  • Paste on X11 windows hangs.

Here are the workaround:

  • download the latest emacs25rc1.tar.gz
  • comment out following lines in src/xselect.c. This Solves pasting issues ( https://m.reddit.com/r/bashonubuntuonwindows/comments/4tpn5r/running_emacs_master_branch_in_recent_wsl_and/ )

    @@ -1194,18 +1194,18 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type,

    timeout = max (0, x_selection_timeout); secs = timeout / 1000; nsecs = (timeout % 1000) * 1000000; TRACE1 (” Start waiting %”pI”d secs for SelectionNotify”, secs);
    wait_reading_process_output (secs, nsecs, 0, false, reading_selection_reply, NULL, 0); TRACE1 (” Got event = %d”, !NILP (XCAR (reading_selection_reply)));

    if (NILP (XCAR (reading_selection_reply))) error (“Timed out waiting for reply from selection owner”); if (EQ (XCAR (reading_selection_reply), Qlambda)) return Qnil;

  • get dependents

    sudo apt-get build-dep emacs24

  • configure

    ./configure –with-x-toolkit=lucid

  • compile

    make -j 4 ( 4 is the number of cores)

  • compile will hang, some thing about gap between XX and YY. Don’t worry.

    su echo 0 > /proc/sys/kernel/randomize_va_space

  • Then compile again
  • Don’t forget to change settings back

    echo 2 > /proc/sys/kernel/randomize_va_space

  • install

    make install


[–]HRoarke 5 points 3 months ago

This is a good guide, but there are a couple of things I had to tweak.

The section with the code got kind of garbled by reddit-formatting. I found another post that had more readable formatting that shows exactly which lines to comment out.

Second, for whatever reason, my sources.list had no repository for actual sources, but that’s needed for build-dep. I added the following to /etc/apt/sources.list

deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse

After adding that, sudo apt-get update is required.

Finally, the lines to change randomize_va_space didn’t work for me as written. They gave ‘Permission denied’ errors, because the su only affects echo whilst the redirect is done by the parent process (the shell). Instead, use

echo 0 | su tee /proc/sys/kernel/randomize_va_space

Then everything worked a treat.

https://www.redditstatic.com/comment-embed.js