събота, 7 октомври 2017 г.

How to make a transition to https

That turned out to be very very simple.
First you need to have some SSL certificate installed, but luckily my hosting provider had already installed AutoSSL  and it was already active.
If you like me have MyBB forum then you need to go to
Home >> Board Settings>>General Configuration  
And change in the field: Board URL http to https.
Finally, in your htaccess file you need to write:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

And that was all.

неделя, 13 август 2017 г.

Sheltered won't load

After the last update of my system, Sheltered ran from Steam, wouldn't load. Which obviously left me devastated or at least very curious what the hell went wrong.
The error I got from running Steam from console was:
GameAction [AppID 356040, ActionID 2] : LaunchApp changed task to WaitingGameWindow with ""
ERROR: ld.so: object '~/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
GameAction [AppID 356040, ActionID 2] : LaunchApp changed task to Completed with ""

But later, after running the game from its directory with
 ./Sheltered.x86_64
it transformed into:
Set current directory to ~/Steam/steamapps/common/Sheltered
Found path: ~/Steam/steamapps/common/Sheltered/Sheltered.x86_64
Mono path[0] = '~/Steam/steamapps/common/Sheltered/Sheltered_Data/Managed'
Mono path[1] = '~/Steam/steamapps/common/Sheltered/Sheltered_Data/Mono'
Mono config path = '~/Steam/steamapps/common/Sheltered/Sheltered_Data/Mono/etc'
displaymanager : xrandr version warning. 1.5
client has 4 screens
displaymanager screen (0)(eDP1): 1920 x 1080
Using libudev for joystick management


Importing game controller configs

Oddly enough, the game would run in I'm offline. 
 So the solution, turned out to be, starting it with:
 ./Sheltered.x86_64 LIBGL_ALWAYS_SOFTWARE=1

After which, the  game started running also from Steam. Go figure.

In the meanwhile, I found this useful script for redirecting the errordump of Steam:
cd ~/.local/share/Steam/linux32
mv steamerrorreporter steamerrorreporter.bak
echo "#!/bin/bash" >steamerrorreporter
echo "exit 0" >>steamerrorreporter
chmod a+x steamerrorreporter
source 
And also, to speed up the game launch:
echo "" > /proc/sys/kernel/core_pattern
 
And also, note the great Arch Steam/Troubleshooting site.  
 
Also oddly enough, KSP starts ok with:
vblank_mode=0 optirun -b primus %command%
even though the suggested is: 
LD_PRELOAD="libpthread.so.0 libGL.so.1" __GL_THREADED_OPTIMIZATIONS=1 %command%_64 -force-gfx-direct 

Other suggested options:
 LD_PRELOAD="libpthread.so.0 libGL.so.1" __GL_THREADED_OPTIMIZATIONS=1 optirun steam
or 
find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete 
or
Remove:

.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6

.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1

.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1

.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6

.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libxcb.so.1 
or
 rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6
I did those and also, I did a reset of Steam and that made Steam stop loading for quite a while, so be careful with those.  
Location of the error dump:
/tmp/dumps     
or
LD_PRELOAD="libpthread.so.0 libGL.so.1" __GL_THREADED_OPTIMIZATIONS=1 optirun steam 

How to switch between PulseAudio outputs with a button

I have horrible problems with my audio, due to a faulted audio jack. Basically what happens is that the PulseAudio keeps on switching between Headphones (which are not plugged in, but it thinks they are) and the Speakers. So what I decided to do is to put a shortcut on my panel to the file:
change_to_speakers.sh with the content:
#!/bin/bash
pactl set-sink-port alsa_output.pci-0000_00_1b.0.analog-stereo analog-output-speaker

then I created a .desktop file with the content:
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Name=Speakers
Type=Application
Comment=Speakers
Exec="~/scripts/change_to_speaker.sh"
Icon=
GenericName=Speakers

After giving permission to run to the sh file with:
$chmod+x change_to_speaker.sh
I can switch to the speakers with just one click. Of course, that doesn't help with my faulty jack but at least makes the situation one idea more bearable.
They say you can also edit:
/etc/pulse/default.pa to: load-module module-stream-restore restore_device=false
to turn off the automatic switching upon detecting new plugged in device but I'd rather not do it, because I don't want it to affect my usb speakers. Though I might do it one day.
Another way to stop the interference of the faulty jack is trough
$hdajackretask 
which is part of alsa-tools-gui.
I tried this once, the effect was total loss of sound on my laptop. So I decided this might be a bit too brutal for my tast.
Also, note I'm not using pactl set-sink-port as in pactl set-sink-port 1 analog-output-speaker because for some reason I get an error when I do it. Maybe because I have more than one sound cards.
Also useful commands to check what sound cards you have and the names of the sinks (or sources) are:
#pactl list sinks 
#pactl list sources
#pactl list cards