duminică, 25 septembrie 2016

OpenSuSE 13.2 / ACER laptop - system goes to sleep

     I have a ACER laptop for quite some time (2009). Most of the time I use it as a desktop computer: the lid is closed and the image goes to a  external monitor. Of course, I disabled the lid-event in order to prevent the system to go to sleep. I never had any problems with that.
     However, this morning, after applying some updates, the system started to behave differently: it was going to sleep every 20 seconds or so, without any obvious reason. I checked all the settings and everything appeared to be normal. If I opened the lid, it was not going to sleep anymore, but when I closed it back, the same problem returned. Ok, I can stay with the lid open, but I don't like it that way.
     So, I have some possibilities:
          1) the system is too old and it's showing its age
          2) there is a new setting after the update and I cannot found it
          3) there is a bug in the update (either a driver or a setting)
     I don't have an answer, but after google-ing a while I have a solution (or, at least, a workaround): I forced the system to ignore the lid.

1) Open Dolphin a SuperUser (you need root access)
2) Edit the file /etc/systemd/logind.conf
3) Add (or modify if it already exists) the following line: HandleLidSwitch=ignore (also make shure it does not have the # character in front of it; this character marks a line as comment and it will be ignored)
4) Save and reboot

luni, 29 februarie 2016

DropBox / OpenSuSE 13.2 / SysTry icon=?

For some strange reason, DropBox icon does not appear in SysTry on OpenSuSE 13.2. I couldn't find a solution or a workaround, so... I designed my own application.
Here it is:
https://www.dropbox.com/sh/if0g7xwgcksdow5/AACREupcxQh_1pYy7JYHwIRDa?dl=0

In Lazarus/FPC, of course.
OK, it's not a complete app: it just reads the status of the Dropbox an changes the color of the SysTry icon, but that's good enough for me

duminică, 22 noiembrie 2015

Games on OpenSuSE

Here are some games and some issues I came across

Jedi Academy
There is a port for Linux of Jedi Academy. However, I have the old Windows versions and it runs excellent in Wine, once you can make it work. So, here are the steps:
1) Make sure that your CD-Rom is configured correctly in Wine. Open WineCfg
2) Install the game (should not be any problems)If the game stacks when you should change the CDs, do the following:
   a) Create an ISO image for each CD an put it somewhere where you can find it (I created a directory in Documents
   b) Create 2 directories (ISO1 andI SO2) and then 2 virtual devices (one for each image) like this:

sudo mount -o loop /home/neklar/Documents/JediAcademy/jediAcdCD1.iso /home/neklar/Documents/Jocuri/JediAcademy/ISO1

sudo mount -o loop /home/neklar/Documents/JediAcademy/jediAcdCD2.iso /home/neklar/Documents/JediAcademy/ISO2

  c) Open WineCfg again and mount those 2 devices. go to advanced properties and specify that they are CD-ROMs
   d) Install the game
3) The Game's executables are jamp.exe (multiplayer) and jasp.exe (single player). You must locate them, because they have to be modified. Typically, they should be in Wine directory, like mine: /home/neklar/.wine/drive_c/Program Files/LucasArts/Star Wars Jedi Knight Jedi Academy/GameData/
4) A good editor to do the trick is Okteta. If you don't have it, install it (package okteta)
5) With Okteta, open the file jamp.exe. Locate the expression GL_EXTENSIONS %s , replace 's' with 'p' (should look like this: GL_EXTENSIONS %p ) then save. Do the same for jasp.exe. Start the game from one of those files (single player or multiplayer) and have fun!
For me, it works on maximum resolution and with all details, both single and multiplayer
Pay attention: There is a noCD pach (or crack ?!) for it, but it will not work with that.

sâmbătă, 7 noiembrie 2015

OpenSuSE 13.2 / Dell Inspiron 1501 / Broadcom B43 wireless solution

I've installed OpenSuSE 13.2 on a older Dell Inspiron 1501 laptop. Everithing was fine, except for the wireless card which refused to work. After searching the internet I found out that the problem was the B34 driver. So, here is my solution:

1) Make sure that the b43-fwcutter package is installed. Open Software Management, search for it and install it if it's not

2) Open Dolphin as SuperUser and find /usr/sbin/install_bcm43xx_firmware
Right click on it and select Actions>Run in Konsole (so that you can see the output).

3) Reboot.

marți, 29 septembrie 2015

OpenSuSE 13.2 / Snapper / free space on ROOT

     I installed OpenSuSE 13.2 a while ago (about 5 months) and I noticed that the used space on ROOT was growing steadily. I ignored the issue until yesterday, when the free space on root was only 760 MB (from a total of 20GB).
     After searching the internet for a while, I concluded that "Snapper" was responsible for that situation.
     As far as I can tell, Snapper is a backup system, so it creates periodically "snapshots" that can be used for recovery. Since I never used it in about 3 years of LINUX, I decided that I don't need this application, and I removed it. Result? About 9 (nine) GB free on rood and a visibly faster system. I admit though that my system is no longer a "modern" one, but it's doing its job: Acer Core 2 Duo 2200 MHz, 3GB RAM, 300GB HDD.
     If you decide to remove the Snapper, the files created for recovery must also be removed, otherwise you accomplished nothing (except the fact that it will stop growing). So, before you uninstall, you must start Snapper from your program list and there you will find all of the backup files ever created, so you can delete them

luni, 21 septembrie 2015

Lazarus / FPC: sort a StringGrid

Here it is, a nice simple procedure that sorts a StringGrid. Tested an a 5000 records StringGrid, the sorting is done in about 1-2 seconds
   sg: your stringgrid
   col: column that will be sorted
   numeric: if the values in column are numbers
   asc: ascendent or descendent
   numeric: if datas are numbers

procedure sort(sg:tstringgrid;col:integer;asc:boolean=true;numeric:boolean);
var i,c:integer; numeric:boolean; f:string; r:real; negat:boolean; x1:integer; semn,s1,s2:string;
begin
  numeric:=false;
  negat:=false;


  if asc=true then sg.SortOrder:=soascending else sg.SortOrder:=sodescending;

  if numeric=false then
     sg.SortColRow(true, col, sg.FixedRows, sg.RowCount-1)
  else begin
     f:='000000000000000.00';
     c:=sg.colcount;
     sg.ColCount:=c+1;
     for i:=1 to sg.RowCount-1 do
       begin
          try r:=strtofloat(sg.Cells[col,i]) except r:=0 end;
          if r<0 then
            begin
              negat:=true;
              sg.Cells[c,i]:='-'+formatfloat(f,r);
            end else sg.Cells[c,i]:='+'+formatfloat(f,r);
       end;
     sg.SortColRow(true, c, sg.FixedRows, sg.RowCount-1);
     if negat=true then
       begin
          x1:=0;
          semn:=sg.Cells[c,0][1];
          s1:=semn; s2:=' ';
          for i:=0 to sg.RowCount-1 do
            if sg.Cells[c,0][1]<>semn then
              begin
                semn:=sg.Cells[c,0][1];
                s2:=semn;
                x1:=i;
              end;
          if s1='-' then
            begin
               if sg.SortOrder=soascending then sg.SortOrder:=sodescending else sg.SortOrder:=soascending;
               sg.SortColRow(true, c, sg.FixedRows, x1-1);
            end;
          if s2='-' then
            begin
               if sg.SortOrder=soascending then sg.SortOrder:=sodescending else sg.SortOrder:=soascending;
               sg.SortColRow(true, c, x1, sg.RowCount-1);
            end;
       end;
     sg.ColCount:=c;
  end;
end;

duminică, 20 septembrie 2015

OpenSuSE 13.2 / Quickview plasmoid

After switching to OpenSuSE 13.2 I found that a certain plasmoid is no longer available - Quickview. Finally, I found the sources and I managed to install it on my system. I also uploaded it here:


Download the archive somewhere where you can use it (Documents, for example) and unpack it (right click > Extract here). You will find a "readme " file with full instructions of how to build and install the plasmoid. Be careful about the required extra packages (kdelibs, libxonq, - devel packages and gettext package) and don't forget to restart the system. The file also contain proper credit for those who created this plasmoid - I have no contribution