I note down things I come across each day, with my views on it. It can be anything that I feel I should write.
Showing posts with label Util. Show all posts
Showing posts with label Util. Show all posts
Sunday, 23 March 2014
Install gnome 3 themes on Ubuntu 12.04
Recently I upgraded my laptop to Ubuntu 12.04. Its better that the best. :-)
While browsing the net for something I stumbled on a very pleasing UI theme for Ubuntu 12.04. I read along following all the links in the page and got to know much about GNOME 3. The themes collection available for GNOME3 was plenty and beautiful. I installed GNOME3 shell on my Ubuntu and then imported some very nice themes, icons from gnome-look.org.
GNOME 3
sudo apt-get install gnome-shell
Download themes
Follow instructions in the theme package about installation, usually the themes are copied to ~/.themes folder, icons are copied to ~/.icons and custom fonts needs to be copied to ~/.fonts.
GNOME tweak tool
This is a tool used to set the themes for UI. Very useful.
sudo apt-get install gnome-tweak-tool
Note:~/ refers to home directory. i.e., '/home/username/'
Wednesday, 29 June 2011
Backup a file using powershell script
Some critical files that I modify each day had to be backed up to a secure location, in case the file gets corrupted I can go to the archive and get the most recent backup.
I created a powershell script to do this. The script is pasted below.
#file name backup.ps1
$PathToGoalsSheet="C:\preformancereports\Akshay"
$FileToBeBackedUp="Goals.xlsx"
$BackupPath="D:\myComany\Dept\Backup"
$TodaysDateFormatted = Get-Date -format dd.MM.yyyy.HH.mm.ss
$BackupFolderName=[string]::Format("{0}.backup",$TodaysDateFormatted)
#Write($BackupFolderName)
if(Test-Path $PathToGoalsSheet)
{
if(Test-Path $PathToGoalsSheet\$FileToBeBackedUp)
{
Write("Creating folder ["+$BackupFolderName+"]...")
New-Item $PathToGoalsSheet\$BackupFolderName -type directory
Write("Copying File ["+ $FileToBeBackedUp +"] into ["+$BackupFolderName+"]...")
Copy-Item "$PathToGoalsSheet\$FileToBeBackedUp" "$BackupPath\$BackupFolderName"
}
else
{
Write("Could not find file ["+ "$PathToGoalsSheet\$FileToBeBackedUp" +"]!")
}
}
else
{
Write("The path ["+$PathToGoalsSheet+"] does not exist!")
}
The command to run this script file, I typed in a batch file (.bat), so I can run the powershell file (or schedule a task to run the batch file on a daily basis). The code in the batch file is as given below.
rem file name backup.bat
@echo off
set scriptHomePath=C:\PowerShell Scripts\
set backupFileScript=%scriptHomePath%backup.ps1
powershell -NoLogo -File "%backupFileScript%"
I created a powershell script to do this. The script is pasted below.
#file name backup.ps1
$PathToGoalsSheet="C:\preformancereports\Akshay"
$FileToBeBackedUp="Goals.xlsx"
$BackupPath="D:\myComany\Dept\Backup"
$TodaysDateFormatted = Get-Date -format dd.MM.yyyy.HH.mm.ss
$BackupFolderName=[string]::Format("{0}.backup",$TodaysDateFormatted)
#Write($BackupFolderName)
if(Test-Path $PathToGoalsSheet)
{
if(Test-Path $PathToGoalsSheet\$FileToBeBackedUp)
{
Write("Creating folder ["+$BackupFolderName+"]...")
New-Item $PathToGoalsSheet\$BackupFolderName -type directory
Write("Copying File ["+ $FileToBeBackedUp +"] into ["+$BackupFolderName+"]...")
Copy-Item "$PathToGoalsSheet\$FileToBeBackedUp" "$BackupPath\$BackupFolderName"
}
else
{
Write("Could not find file ["+ "$PathToGoalsSheet\$FileToBeBackedUp" +"]!")
}
}
else
{
Write("The path ["+$PathToGoalsSheet+"] does not exist!")
}
The command to run this script file, I typed in a batch file (.bat), so I can run the powershell file (or schedule a task to run the batch file on a daily basis). The code in the batch file is as given below.
rem file name backup.bat
@echo off
set scriptHomePath=C:\PowerShell Scripts\
set backupFileScript=%scriptHomePath%backup.ps1
powershell -NoLogo -File "%backupFileScript%"
Subscribe to:
Posts (Atom)