http://stackoverflow.com/questions/11879287/export-git-with-version-history
Category Archives: Software Development
How to install .Net Core on Ubuntu 16.04
Add the dotnet apt-get feed
In order to install .NET Core on Ubuntu, you need to first set up the apt-get feed that hosts the package you need.
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 sudo apt-get update
Install .NET Core SDK
Before you start, please remove any previous versions of .NET Core from your system by using this script.
sudo apt-get install dotnet-dev-1.0.0-preview2-003121
Initialize some code
Let’s initialize a sample Hello World application!
mkdir hwapp cd hwapp dotnet new
Run the app
The first command will restore the packages specified in the project.json file, and the second command will run the actual sample:
dotnet restore dotnet run
And you’re ready!
You now have .NET core running on your machine!
Source: .Net Core on Ubuntu
Speeding up database access
This is a very thorough article on ways to speed up a SQL database by Matt Perdeck
backup of VMWare using ghettoVCB.sh
You can back up VMware VM for free using ghettoVCB.sh script. Everything you need is here:
https://github.com/lamw/ghettoVCB
I was unable to download it directly to the the VMware server because wget v1.19 refused to download form https:// url.
Instead I downloaded the file to my Windows machine and used WinSCPPortable to upload the file to the server.
To extract the files do:
unzip ghettoVCB-master.zip
Go to ghettoVCB-master folder and make the scripts executable:
chmod +x ghettoVCB.sh
chmod +x ghettoVCB-restore.sh
Add a new NFS share as a datastore “backup”. This is where we are going to store the backup files.
Create some folders and configuration files. A typical way to execute the script is:
./ghettoVCB.sh -f vms_to_backup -g global_config/vm_global.conf
To schedule a cron job add the following line to /var/spool/cron/crontabs/root
0 0 * * 1-5 /scratch/ghettoVCB-master/ghettoVCB.sh -f /scratch/ghettoVCB-master/vms_to_backup -g /scratch/ghettoVCB-master/global_config/vm_global.conf > /vmfs/volumes/backup/ghettoVCB-backup-$(date +\%s).log
Then add the following to /etc/rc.local.d/local.sh
/bin/kill $(cat /var/run/crond.pid)
/bin/echo “0 0 * * 1-5 /scratch/ghettoVCB-master/ghettoVCB.sh -f /scratch/ghettoVCB-master/vms_to_backup -g /scratch/ghettoVCB-master/global_config/vm_global.conf > /vmfs/volumes/backup/ghettoVCB-backup-\$(date +\\%s).log” >> /var/spool/cron/crontabs/root
crond
In order to allow the script to send emails you need to:
Step 1 – Create a file called /etc/vmware/firewall/email.xml with contains the following:
outbound tcp dst 25 true false
Step 2 – Reload the ESXi firewall by running the following ESXCLI command:
~ # esxcli network firewall refresh
Step 3 – Confirm that your email rule has been loaded by running the following ESXCLI command:
~ # esxcli network firewall ruleset list | grep email email true
Step 4 – Connect to your email server by using nc (netcat) by running the following command and specifying the IP Address/Port of your email server:
~ # nc 172.30.0.107 25 220 mail.primp-industries.com ESMTP Postfix
To perform a dry run restore do:
./ghettoVCB-restore.sh -c vms_to_restore -d 1
To perform a real restore do:
./ghettoVCB-restore.sh -c vms_to_restore
HTTP Error 503. The service is unavailable
I recently had a problem with IIS on Windows 7 where trying to access http://localhost on the default port 80 was giving me an error:
“HTTP Error 503. The service is unavailable”
I spent several hours trying to find the cause and trying different things without any success.
Finally I came across this post that helped me resolve the problem.
The root cause was an URL Reservation http://+:80/
To remove the reservation type the following in a command prompt (but first read the post to know what your are doing):
netsh http delete urlacl http://+:80/
Free SSL certificate from StartSSL
If you own a web site and would like to provide better security to your visitors in terms of encrypted communication between your server and their browser you need to install a SSL Certificate. You can get a certificate from different companies and the price can vary.
The StartSSL
log4net contextual properties and ASP.NET
I just found this article that helped me to find the answer about the weird results with my log files produced by ASP.NET application:
log4net contextual properties and ASP.NET
Big thank you to the author!
Script to restore SQL Server database
A lot of people know how to restore an SQL Server database using the SQL Server Management Studio. Sometime it will not work if the database is in use. You have to close all active connections or even to take database offline and then online again.
It is much easier to restore the database via the attached script. Just unzip the file to a folder called C:\RestoreDB and copy the backup file to the same folder. Then edit RestoreDB.bat file and update it with the appropriate information – server name, user name, password, backup name, etc.
The last step is to run RestoreDB.bat – you can double-click it in Windows explorer or can oped a DOS prompt change the folder to C:\RestoreDB and run the script by typing its name and pressing “Enter” key.
Configure FreeNAS iSCSI and VMWare ESXi (w/AUDIO!)
This is a very useful video that describes how to configure FreeNAS iSCSI as a data store for ESXi. The credits go to mrholverson
A copy of this video is available here
TRUNCATE Log File in SQL Server 2008
USE [TestDb]
GO
ALTER DATABASE [TestDb] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(TestDbLog, 1)
ALTER DATABASE [TestDb] SET RECOVERY FULL WITH NO_WAIT
GO