Simple command line utility with decent readable output:
diff -u file1.txt file2.txt
Production Support
United Future Data Load (5am crontab)
Use the following command to look for bad data load problems:
ls -l /prod/polar/logs/*.bad
Stsadm commands for backup, restore, and locking site
Use stsadm to lock a SharePoint site prior to backup.
Refer: msft articleExamples
A common situation where the getsitelock and setsitelock operations are useful is when a site is backed up. Typically, before you back up a site collection, the site should be locked and no users should have access to it.
Lock Site
To determine the lock status of the site, you can use the following getsitelock syntax:
stsadm -o getsitelock -url http://server_name
Once the lock status of the site collection is determined, you can use the noaccess parameter of the setsitelock operation to lock out all users to the site:
stsadm -o setsitelock -url http://server_name -lock noaccess
You can also use the following command to put the site into "read only" access:
stsadm -o setsitelock -url http://server_name -lock readonly
Backup Site
You can use the Backup operation to create a backup of the site collection:
stsadm -o backup -url http://server_name -filename "filename.bak" -overwrite
After the site has been backed up, you can use the none parameter of the setsitelock operation to remove all locks to the site:
stsadm -o setsitelock -url http://server_name -lock none
Restore Site
stsadm -o restore -url http://w2k3vpc -filename filename.bak -overwrite
Delete Site
stsadm -o deletesite -url http://w2k3vpc
Manage Server Farm with Scripts
sharepoint-buildout-farm-scripts
Enumeration / Details
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE" -o enumsubwebs -url http://efleet
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE" -o enumsites -url http://efleet
Scones
2 cups all-purpose flour (2 x 128g)
1/3 cup sugar, plus more for dusting
1 teaspoon baking powder
1/4 teaspoon baking soda
1/2 teaspoon salt
8 tablespoons unsalted butter, cold and cut into small pieces
1/2 cup sour cream
1 large egg
1 tsp ground cinnamon
Water: 1 cup = 236 grams
Milk, non-fat: 1 cup = 245 grams
Sugar: 1 cup = 200 grams
1/2 Batch
128g cups all-purpose flour
33g sugar
1/2 teaspoon baking powder
1/8 teaspoon baking soda
1/4 teaspoon salt
4 tablespoons unsalted butter, cold and cut into small pieces
1/2 tsp ground cinnamon
62g milk
1 large egg
Adjust oven rack to lower-middle position and preheat oven to 400 degrees F.
In a medium bowl, mix flour, 1/3 cup sugar, baking powder, baking soda, salt and cinnamon. Add the pieces of diced butter and combine, with your hands, until the mixture resembles coarse bread crumbs.
In a small bowl, whisk sour cream and egg until smooth. Using a fork, stir sour cream mixture into flour mixture until large dough clumps form. Use your hands to press the dough against the bowl into a ball. (The dough will be sticky in places, and there may not seem to be enough liquid at first, but as you press, the dough will come together.)
Place on a lightly floured surface and pat into a 7- to 8-inch circle about 3/4-inch thick. Sprinkle with approximately 1 1/2 tsp. of sugar. Use a sharp knife or pizza cutter to cut into 8 triangles; place on a cookie sheet (preferably lined with parchment paper), about 1 inch apart.
Bake until golden, about 15 to 17 minutes. Cool for 5 minutes and serve warm or at room temperature.
Installing Perl Packages, debugging with Eclipse
I'll need a little more research, and I may have already installed some things, don't remember.
Ran the following command, and kept hitting enter for all responses, added all repositories.
# perl -MCPAN -e shell
Then ran the following command in CPAN
cpan> install PadWalker
cpan> exit
You need to install PadWalker prior to installing Epic inside Eclipse for Perl debugging.
Free AVG Antivirus for Ubuntu
You can get the free updates here, install as a regular package.
http://free.avg.com/download-update-7#tba1
You also need to run the following commands to get the update to work:
sudo chmod 775 /opt/grisoft/avg7/bin/avgupdate
cd /opt/grisoft/avg7/var/
sudo chmod 777 run
sudo chmod 777 update/log
I also needed to manage groups and add everyone to the AVG group, logout and login again to pickup the new virus defintion files.
Yoshinoya Beef Bowl
1. Mix the following in a sauce pan & simmer (covered)
- Soy sauce 50 ml
- White wine 195 ml
- Molasses 1 Tbsp
- Brown sugar 3 Tbsp
- Sake 1 Tbsp
- Salt 1 tsp
- Black pepper 1tsp (20 grinds)
- Ground ginger 1/4 tsp
- Garlic 1/2 clove
- Boulion (smidgen) 1tsp
2. Cut 2 onions like moon 1" wide
3. Add onion to sauce cook 15 mins. until tender and almost brown colored
4. Add sliced beef, and simmer for 5 mins. until cooked
Select and Insert into table
create table temp1 as select field1, field2 from table1
Simple Time Difference
#!/usr/bin/perl
use Time::Local;
print &daysFromNow('20','NOV','08');
exit 0;
# timegm returns seconds from 1970
# its format is (0,0,0,day 1..31,month 0..11,year)
sub daysFromNow
{
my $date2checkDD = $_[ 0 ];
my $date2checkMMM = $_[ 1 ];
my $date2checkYY = $_[ 2 ];
my $check_day = $date2checkDD;
my $check_month;
if ( $date2checkMMM eq 'JAN' ) { $check_month = 0; }
elsif ( $date2checkMMM eq 'FEB' ) { $check_month = 1; }
elsif ( $date2checkMMM eq 'MAR' ) { $check_month = 2; }
elsif ( $date2checkMMM eq 'APR' ) { $check_month = 3; }
elsif ( $date2checkMMM eq 'MAY' ) { $check_month = 4; }
elsif ( $date2checkMMM eq 'JUN' ) { $check_month = 5; }
elsif ( $date2checkMMM eq 'JUL' ) { $check_month = 6; }
elsif ( $date2checkMMM eq 'AUG' ) { $check_month = 7; }
elsif ( $date2checkMMM eq 'SEP' ) { $check_month = 8; }
elsif ( $date2checkMMM eq 'OCT' ) { $check_month = 9; }
elsif ( $date2checkMMM eq 'NOV' ) { $check_month = 10; }
elsif ( $date2checkMMM eq 'DEC' ) { $check_month = 11; }
my $check_year = "20$date2checkYY";
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime( time );
$time_1=timegm(0,0,0,$mday,$mon,$year);
$time_2=timegm(0,0,0,$check_day,$check_month,$check_year);
$seconds = $time_2 - $time_1;
$days = $seconds / 86400; # 60*60*24 = 86400
return $days;
}
