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.

Wednesday, February 10, 2016

Dump Table date to SQL using Microsoft SQL Server

You can export the data in a table or DB into a SQL query using Microsoft SQL server Management studio by doing:
right click on the DB -> Tasks -> Generate Scripts. On the wizard step titled "Set Scripting Options" choose "Advanced" and modify the "Types of data to script" option to "Data"

This question was answered in http://serverfault.com/questions/147638/dump-microsoft-sql-server-database-to-an-sql-script

Tuesday, February 02, 2016

Install Disk cleanup in windows 2008 r2

The site basics.net have the instructions how to install the disk cleanup nicely (the default Microsoft way is crap because you end up withi loads of stuff installed in the system), the article with the instructions is http://www.basics.net/2013/02/25/win-server-2008-r2-how-to-enable-the-disk-cleanup-utility/
Copy 2 files to specific system folders and you can immediately use the tool:

Copy Cleanmgr.exe to %systemroot%\System32.
Copy Cleanmgr.exe.mui to %systemroot%\System32\en-US.
The 2 files are located in
- C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe
- C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui

You can simply run this as administrator:
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe %systemroot%\System32
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui %systemroot%\System32\en-US

Thursday, January 07, 2016

Enable unsigned plugins in firefox

The latest version of Firefox (43.0.1) disables all unsigned plugins, to be able to allow unsigned plugins to run edit the setting:
xpinstall.signatures.required
Set it it false.
The suggestion was found in the forum https://support.mozilla.org/en-US/questions/1078339

Sunday, October 18, 2015

Chose user used by samba

Problem:
I wanted to have a samba share with guest access, and the user used by samba to write on the server to be a specific user account, so that I could also manipulate the files placed in the share.

By default the user used was nobody, and the I was having problems using the local linux account in the server to manipulated files, as it did not have the correct access rights.
The option that solved my problems was:

[Share]
path = 
writeable = Yes
force user =  # this was the line that fixed the nobody user
guest only = Yes 
guest ok = yes
browseable = Yes
public = yes
hide dot files = no

Sunday, September 13, 2015

Virtual box and ubuntu

I was trying to install Ubuntu 15.04 (ubuntu-15.04-desktop-amd64.iso) as a guest system on Virtual box 5.0.0 running on a macOS host system.
The problem I was facing was the install crashing and not able to finish. Looking I found a blog, the solution that worked for me was :
Disabling "Nested Paging" in Setting->System->Acceleration allows to start the system.

Thursday, September 03, 2015

How to change default application in a website in IIS

The solution to set one application as the default for when you hit a website is to change the website Physical folder, to match the application root folder. As explained in a Server fault post.
Another hack-around is to put a index.html page in the root of the site performing the re-direct.
Using the redirect feature of ISS can cause trouble with you application, I recommend against it.

The best answer form me is:
Turns out you can edit the physical path of the Default Web Site (right click, Manage Web Site, Advanced Settings). Change that to the physical path of the app you want to be default, make sure other settings match (in my case the App Pool had to be changed), and there you go.
Direct link to best reply

Wednesday, July 09, 2014

blogspot: how to insert code

To insert code nicely formatted in blogspot use the following code:
<pre><code>
my code goes here...
</code></pre>

emacs: saves all the backup into a single folder

A nice settings suggested in http://www.emacswiki.org/emacs/BackupDirectory to get all your backup files created by emacs in a single folder, to do this I setup the following settings:
;; Put all backups in a folder
(setq
 backup-by-copying t
 backup-directory-alist `(("." . "~/.emacs_saves"))
 delete-old-versions t
 kept-new-versions 6
 kept-old-versions 2
 version-control t)