Adding proxy to MSYS2

If you ever need to use a proxy when updating / installing packages in msys2 you’ll have to set the following environnement variables, and put them i.e in your .bash_profile :

# .bash_profile example
# Note: username and password have to be url encoded in case they contain special chars
export http_proxy=http://USERNAME:PASSWORD@proxy:port
# or like this if not user/password required
# export http_proxy=http://proxy:port
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
# if you need a proxy ignore list
export no_proxy="localhost,127.0.0.1,localaddr,.yourlocaldomain.ext,.local"

MSYS2 ALLEGRO5 Setup

I’ve set up my last allegro 5 install + compilers in less than 15 minutes.

1) download and install msys2 ( https://www.msys2.org/ )

Now launch the msys2 terminal and copy pasta the followings:

#UPDATE MSYS2
pacman -Syu
#INSTALL GCC 32 & 64BITS
pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git subversion mercurial mingw-w64-i686-cmake mingw-w64-x86_64-cmake
#INSTALL ALLEGRO5 32 & 64BITS
pacman -Sy mingw32/mingw-w64-i686-allegro mingw64/mingw-w64-x86_64-allegro 
#INSTALL ALLEGRO5 64BITS DEPENDENCIES
pacman -Sy mingw-w64-i686-dumb mingw-w64-i686-flac mingw-w64-i686-opusfile mingw-w64-i686-freetype mingw-w64-i686-libjpeg-turbo mingw-w64-i686-libpng mingw-w64-i686-libvorbis mingw-w64-i686-libwebp mingw-w64-i686-openal mingw-w64-i686-physfs
#INSTALL ALLEGRO5 32BITS DEPENDENCIES
pacman -Sy mingw-w64-x86_64-dumb mingw-w64-x86_64-flac mingw-w64-x86_64-opusfile mingw-w64-x86_64-freetype mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng mingw-w64-x86_64-libvorbis mingw-w64-x86_64-libwebp mingw-w64-x86_64-openal mingw-w64-x86_64-physfs

CYGWIN: list all process arguments

A few days ago I had to list the arguments for specific process.
While finding it using “ps -aef | grep ‘processname'” and getting the information is trivial under linux, it is not the case using cygwin, which is only reporting process name and pid when calling “ps”.

A lot of solutions involve installing cygwin packet, like pstree.

Another solution is to search the /proc/pid/cmdline files, like here:

grep -a /proc/*/cmdline | xargs -0
/proc/1990/cmdline:/bin/sh /usr/bin/startxwin
/proc/2016/cmdline:xinit /etc/X11/xinit/startxwinrc — /usr/bin/XWin :0 -multiwindow -auth /home/user/.serverauth.1990
/proc/2017/cmdline:/usr/bin/XWin :0 -multiwindow -auth /home/user/.serverauth.1990
/proc/2023/cmdline:/usr/bin/xwin-xdg-menu
/proc/2035/cmdline:dbus-launch –sh-syntax –exit-with-session
/proc/2036/cmdline:/usr/bin/dbus-daemon –fork –print-pid 5 –print-address 7 –session
/proc/2046/cmdline:/usr/libexec/gam_server
/proc/2512/cmdline:mintty
/proc/2513/cmdline:bash
/proc/3441/cmdline:grep –color -a /proc/1990/cmdline /proc/2016/cmdline /proc/2017/cmdline /proc/2023/cmdline /proc/2035/cmdline /proc/2036/cmdline /proc/2046/cmdline /proc/2512/cmdline /proc/2513/cmdline /proc/3441/cmdline /proc/self/cmdline
/proc/self/cmdline:grep –color -a /proc/1990/cmdline /proc/2016/cmdline /proc/2017/cmdline /proc/2023/cmdline /proc/2035/cmdline /proc/2036/cmdline /proc/2046/cmdline /proc/2512/cmdline /proc/2513/cmdline /proc/3441/cmdline /proc/self/cmdline

To restrain it to a particular process i.e XWin, excluding grep command:

grep -a “XWin” /proc/*/cmdline |xargs -0 |grep -v grep
/proc/2016/cmdline:xinit /etc/X11/xinit/startxwinrc — /usr/bin/XWin :0 -multiwindow -auth /home/user/.serverauth.1990
/proc/2017/cmdline:/usr/bin/XWin :0 -multiwindow -auth /home/user/.serverauth.1990

KrampusHack 2020 FINISHED

And here is my entry: a space shooter !

RazorCrest (click here to download)

Task (for NunoMartinez):

Finally, here it is my wishlist:
* Fast game. I mean that you can play a complete “play” in few minutes.
* Minimalistic graphics. Don’t make them complex.
* Finally, select one of your own wishes.

How I achieved the rules:

  • Fast game. I mean that you can play a complete “play” in few minutes.
    ===> You start it you play
  • Minimalistic graphics. Don’t make them complex.
    ===> Only 4 sprites and they are very basic due to my drawing style, the rest is only circles, triangles and rectangles
  • Finally, select one of your own wishes.
    ===> Particles !!!

How to play:

-up to start moving
-arrows to move the ship
=> more XP = quicker
-use the mouse to aim and use mouse button or key CTRL to fire
=> more XP = more and better bullets, better accuracy
-green monsters are light enemies that are just traveling here
-yellow monsters are aggressives enemies that are targeting you
-red monsters are very aggressives enemies that are targeting you, and they are more solid
-the more you kill the more power you have to kill
-hitting the walls or being hit by an enemy makes you loose life and XP (thus fire power)

Screenshots:

Building from source:

-Go with a shell into to SRC/KRAMPUSHACK2020
-Type make
-If it works move the binary to ../..
-If it’s not working, come and complain here :-p

Hint for finishing

-Because the ship can speed up does not mean you should use it all the time
-Kill as much as you can on first levels so you have the firepower for next levels
-Use thrust/slow down/side jumps to avoid enemies while shooting at them

X11 / xserver / XWIN gvim problems

Case:

WARNING**: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

Solved by adding NO_AT_BRIDGE=1 before launching gvim ( i.e [user@server]$ NO_AT_BRIDGE=1 gvim myfile.txt) source: https://github.com/NixOS/nixpkgs/issues/16327

Case:

connect /tmp/.X11-unix/X0: Permission denied
E233: cannot open display
Press ENTER or type command to continue

Solved by using correct DISPLAY informations before connecting (DISPLAY=localhost:0.0) source: https://unix.stackexchange.com/a/220234

execve: no such file or directory

If one day when using execve you encounter the “no such file or directory” problem, and that the file you tried to launch is really existing and with the good rights, then the problem is coming from the shebang not pointing to a valid interpreter.

In example: #!/bin/ksh and ksh is not installed

#reminder #execve