Saturday, June 01, 2024

Change font size on Gnu chash

To chnage the GNU Cash font size on windows I created the file %APPDATA%\GnuCash\gtk-3.0.css with the contents:

  #gnc-id-main-window {
    font-size: 16pt;
  }
  
Source: GnuCash help

Sunday, April 09, 2023

Copy lineage OS to phone to install from there

 I was having problems installing lineage OS using the sideload method, so I decided to use the copy and install method.

The steps where:

  1.  Set the phone in recovery mode with TRW
  2. Copy the lineageOs zip to tmp with the command  adb push "lineage-14.1-20170921-nightly-oneplus2-signed.zip" /tmp
  3. Copy the  google apps adb push "open_gapps-arm64-7.1-nano-20170922.zip" /tmp
  4. In  TRW 
    1. Select Install
    2. Navigate to /tmp and select the file lineage-14.1-20170921-nightly-oneplus2-signed.zip
    3. Select additional zip and select  open_gapps-arm64-7.1-nano-20170922.zip
    4. Press install
  5. Reboot

On reboot I got the phone stuck because no SIM was present, the wizard kept crashing, I needed to install a SIM to pass this point.

Then I got the message "Sign in with a google account that was previously synced on this device", I logged in with the original google account, to validate the phone had not been stolen, but after that I could select a new google account to use in the phone

 


Sunday, September 13, 2020

S3 Permissions to mail-in-a-box backup

 To backup mail-in-a-box to AWS S3 you need:

  1. Have a AWS account
  2. Create a S3 bucket to store the backups (you will need to note the region)
  3. Create a group, e.g. backup-email-group, with the single policy shown bellow
  4. Create a IAM user with programmatic access as a member of the backup-email-group. Note down the Access key and Secret Access Key
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::my-bucket-name"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:DeleteObject"
            ],
            "Resource": "arn:aws:s3:::my-bucket-name/*"
        }
    ]
}
This policy was posted in the mail-in-a-box forums.

Saturday, June 06, 2020

Update Lineage Os in a oneplus 2

The instructions posted here in the Lineage OS web site regarding the update of oneplus do not work for me, I can't get the command adb reboot sideload to work, it simply reboots my phone.
So these are the steps I took to update my phone to the latest version.
    1. Restart phone in recovery mode:
        power + volume down (will also take screenshot, just wait)
     or
        adb reboot recovery
    2. In TRW select Advanced > ADB sideload > slide to start sideloading
    3. Run command
    adb sideload .\lineage-17.1-20200601-nightly-oneplus2-signed.zip
wait...takes some time, you should see progress indicator
    4. In TRW select ADB sideload and run command
adb sideload .\open_gapps-arm64-10.0-nano-20200530.zip
    5.Reboot.. Wait a long time


Visual studio: start mutiple projects

There is a nice tool that allows you to define combination of multiple projects that should be started together when running things from Visual studio, the extension is called SwitchStartupProject and can be found here:

Tuesday, March 17, 2020

Visual studio: Class from XML or json

Visual studio has a nice hidden feature, that it is able to generate classes from XML and JSON data.
To be able to use you need:
  1. Create an empty class file (.cs file)
  2. Copy the JSON/XML to the clipboard
  3. Go to Visual Studio -> Edit -> Paste Special -> Paste as class
and you will be left with a nice class.

Sunday, December 08, 2019

Hack to include Gif in jAlbum

I'm currently using jAlbum version 13 (I highly recommend this software) and I came across the problem to include GIFs.
By default jAlbum was converting the GIF to JPG and using the generated file. To be able to include a GIF I do the following:
  1.  Create a gifs folder in the root of the output directory
  2. Copy the GIFs to this folder
  3. Open the project and drag an drop the GIFs to de desired location
    1. When asked, select to link the image
    2. Right-click the image and select "Include Original"
Now the GIF will be available as the ultimate link (after the slide page).

It seems that the newest version of jAlbum supports including GIFs as I expect it, but I have not tried it.

davidekholm wrote:
I've added support to use an original file as "closeup image" instead of a scaled/processed version to the upcoming jAlbum 13.10 now. This is perfect for making animated GIF images animate within slide pages. To try it out, ensure you're running jAlbum 13.9, then replace lib/jalbum-core.jar with this beta . You can also replace your texts/texts.properties file with the attached one.
Once done, right-clicking an image will reveal the new "Use original" option. Just click it and make the album again. Note, animated GIFs aren't supported by jAlbum's embedded web browser so you have to open the final album in an external web browser to see the animation.
References:
https://jalbum.net/forum/thread.jspa?threadID=52107 

Sunday, December 09, 2018

Add user to windows

WTF!? Why do I have to give option for password recovery when creating a local user account!!!

On windows 10, Going through the normal user dialogs is painful, Microsoft tries so hard to only allow you to add Microsoft accounts to your machine that is maddening.

If you just want to add a nice, simple local user account you will have to directly call the old add user application, to do you have to call it from the run command, so:
  1. Open the run command dialog: Windows key + R
  2. Open the user dialog, by running the command: control userpasswords2

Monday, June 18, 2018

Add NAT to Hyper-V

New-VMSwitch -SwitchName “vNAT” -SwitchType Internal


New-NetIPAddress -IPAddress 10.1.3.1  –PrefixLength 24  –InterfaceAlias "vEthernet (vNAT)"

 Get-NetAdapter

 New-NetIPAddress -IPAddress 10.1.3.1  –PrefixLength 24  –InterfaceIndex 65
New-NetNAT -Name “NATNetwork” -InternalIPInterfaceAddressPrefix 10.1.3.0/24

Set ip of guest to 10.1.3.2

https://cloudtidings.com/2017/10/31/hyper-v-networking-improvements-nat-and-what-does-it-means-to-you/

Sunday, October 30, 2016

Install borgbackup in raspberry pi

I'm using the current lastest version of raspbian
cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
(if you are in a previous version run rpi-update and see This link)

Install the required packages
sudo apt-get install python3-pip libacl1-dev liblz4-dev python3-dev libssl-dev liblz4-dev libacl1-dev
Then install the python packages
sudo pip3 install lz4 borgbackup

Saturday, October 15, 2016

Choose what user to run the service under systemD

The systemd services are located in /etc/systemd, locate the desired service, e.g. the transmission-daemon service is located under /etc/systemd/system/multi-user.target.wants/transmission-daemon.service and the under the section

[Service]
User= <user that will run the service>
After I did the change I had to reboot to see the result.

Thursday, August 25, 2016

Start dropbox at reboot in linux

I was having problem in my ubuntu machine that the dropbox was not running, because it did not started at reboot. The command dropbox autostart y did not work, and I tried it running as root or my normal user.

So to solved it I decide to use cron, so I run crontab -e and add the line

@reboot $HOME/.dropbox-dist/dropboxd
This did it, now I get dropbox running after a reboot.

Wednesday, June 22, 2016

Configure postfix to accept all email addresses

There is a solution in http://serverfault.com/questions/514643/postfix-accept-all-email-to-any-user-at-any-domain reporting a solution similar to what I needed.
I'm running raspbian so I think a some things are different, another difference is that I only want to accept addresses to my domain.
The solution was:
  1.  Create the file /etc/postfix/virtual with the content:
    /.*@example.com/ spamuser
  2. Add the following line in file /etc/postfix/main.cf:
    virtual_alias_maps = regexp:/etc/postfix/virtual
  3. Activate the virtual file: postmap /etc/postfix/virtual
Additional notes:
  • The solution in serverfault suggested to use virtual_alias_maps = pcre:/etc/postfix/virtual, with this line I was having the following warning:
    error: warning: pcre:/etc/postfix/virtual is unavailable. unsupported dictionary type: pcre.
    Apparently my install was expecting regexp instead of pcre. To find out the capabilities of your install you can run the command postconf -m
  • To check the status of the service run service postfix status, you will also get a tail of the log, was useful to see configuration errors.

Monday, May 23, 2016

Garming GPS dowload Maps to SD instead of device

Create folder \Garmin on the SD card.
Copy the file garmindevice.xml from \Garmin folder of your device into the \Garmin folder of the SD card.
Run the Garming express , it should detect the SD card as a Garming GPS.

The map files will end up on the SD card in folder \.system and will be named gmapprom.img, gmapprom.unl and gmapprom.gma. Create folder \Map on the SD card and move these three files into it. You can then rename the files from gmapprom to any name of your choosing, but keep the .img, .unl and .gma extensions.

If your device has junction views, you will find a JCV folder within the \.system folder on the SD card. Move the JCV folder and its contents into the \Garmin folder of the SD card.

Full details in http://www.poi-factory.com/node/39231

Thursday, March 10, 2016

Visual Studio sql hide design

To have visual studio show SQL and now show the design panel, follow the following:
  1. Right-click on the file, and select Open With...
  2. Then select Microsoft SQL Server Data Tools, T-SQL Editor,
  3. Click on Set as Default
  4. Click OK.

From question in Stackoverflow

Friday, March 04, 2016

Visual studio: Enable debug of external code

  1.  Go to the Debug-->Exceptions dialog, check Common Language Runtime Exceptions, and check the check box in the Thrown column;
  2.  Go to the Tools-->Options-->Debugging and uncheck the Enable Just My Code (Managed Only) check box.

Source

Friday, February 26, 2016

All the Special Key Combinations that Change Your Mac's Startup

From http://lifehacker.com/all-the-special-key-combinations-that-change-your-macs-1761327018
  • Shift: Starts your Mac in safe mode. This helps you troubleshoot because it only loads the minimum necessary kernel extensions at boot then disables startup items, user-installed fonts, font caches, kernel caches, and other system cache files. Safe mode also runs a file system check automatically, which should help with troubleshooting. 
  • Option: This loads up the startup manager where you can pick between different hard drives or discs to boot into. If you need to boot from a hard drive different than your primary one, or you’re booting into Boot Camp, this is the key you push. 
  •  C: Boots from a bootable CD, DVD, or USB. This is useful when you’re installing a new operating system. 
  • D or Option+D: Starts the Apple Hardware Test on pre-2013 Macs or Apple Diagnostics on newer Macs. Both are meant to help troubleshoot hardware issues. N or 
  • Option+N: Starts up from a Netboot server. Most average users will never need to use this as it’s meant for running OS X off a network instead of a hard drive or disc drive. 
  • Command+R: Starts up in Recovery mode. If you have problems with your hard drive, OS X Recovery allows you to restore your Mac from a backup, verify and repair your disc, check your internet connection, or reinstall OS X. 
  • Command+Option+R: Starts up the internet version of Recovery mode, which works the same as regular Recovery mode, but is online. 
  • Command+Option+P+R: This resets the NVRAM. NVRAM stores information about speaker volume, screen resolution, startup disk selection, and recent kernel panic information. If you’re having issues with sound or video, it’s usually a good idea to reset the NVRAM before panicking. 
  • Command+S: Starts up in single-user mode. This is meant mostly for developers and IT as a means to troubleshoot startup issues and basically drops you into the command line where you can run tests without worrying about the GUI in OS X. 
  •  Command+V: Starts up in verbose mode. Verbose mode is similar to single-user mode but is meant more as a way to watch what a computer is doing to help with troubleshooting. 
  • T: Starts your Mac in target disk mode. This is a useful way to share files between two Macs when one of them is broken or the display isn’t working. 
  • Eject button, F12, mouse button, or trackpad button: Force eject an optical disk.

Edit site permissions in Firefox

It used to be simple to edit site permission sin Firefox, you only needed to click the icons on the left of the awesome bar and you would see the connection security (encrypted/unsecured) and the permissions pane with the switches to allow as default, permit or deny.
Currently in Firefox 44.0.2, the Permissions pane only shows you the current permission of the site, not allowing you to edit them. To edit the permissions of the current site you have to:
  1. Click on the icons in the left of the awesome bar, 
  2. Click on the arrow of the panel describing the connections security

  3. Click on the Button "More Information"

  4. Click on the tab "Permissions"
  5. Now you can edit the website permissions
To See and edit permissions to all websites, including the default permissions, you can type
about:permissions in the awesome bar.