Jump to content

Влади's Blog

  • публикации
    5
  • коментара
    2
  • преглеждания
    18598

Относно този блог

Публикации в този блог

 

Install Google Chrome on Windows Server with a Powershell Script

$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)  

Влади

Влади

 

OS X Server update breaks PostgreSQL

The OS X Server 3.2.1 just released appears to break PostgreSQL during the update process. The new version of Postgresql installed (9.3.x over 9.2.x) contains an updated configuration field: “unix_socket_directory” becomes “unix_socket_directories”, the value doesn’t change, just the name. The installer also appears to fail while upgrading the PostgreSQL data, causing the process to crash. Thanks to the helpful users on the Apple Discussion boards here a fix has been found. As always, back up before you change anything! To resolve the issue first stop the postgres service (2 commands) : sudo su serveradmin stop postgres Update the configuration field (1 command) : pico /Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist replace unix_socket_directory with unix_socket_directories save & exit Move the PostgreSQL data folder (1 command) : mv /Library/Server/PostgreSQL/Data /Library/Server/PostgreSQL/DataOld Recreate the standard PostgreSQL Data folder and initialise a blank database (1 command) : sudo -u _postgres /Applications/Server.app/Contents/ServerRoot/usr/bin/initdb /Library/Server/PostgreSQL/Data -E utf8 --lc-collate=C --lc-ctype=C Update the data in the blank database with data from the DataOld folder (1 command) : sudo -u _postgres /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_upgrade -b /Applications/Server.app/Contents/ServerRoot/usr/libexec/postgresql9.2 -B /Applications/Server.app/Contents/ServerRoot/usr/bin -d /Library/Server/PostgreSQL/DataOld -D /Library/Server/PostgreSQL/Data Restart the PostgreSQL service (2 commands) : launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/org.postgresql.postgres.plist serveradmin start postgres Source: Here

Влади

Влади

 

Windows Loader - Status:modified - uninstall other cracks

Ако виждате съобщението по горе при опит за активиране на Windows 7, или ви е паднала активацията на WIndows-а Стартирате cmd като администратор и изпълнявате sfc /scannow Рестартирате. Ако изпълнявате тази стъпка след паднала активация, най-вероятно ще имате съобщени "Status: Notification" след изпълнение на стъпката по горе. Решението

Влади

Влади

 

Solve Windows Loader “Status: Notification” Issue

Open the start menu. Type in cmd. Right-click on the option cmd, and choose “Run as administrator”. If prompted, click on Yes or Continue to continue. In the black window that opens, type slmgr -rearm exactly as shown here. Press Enter on your keyboard. A message will appear saying Command completed successfully. Restart your system. Restart your computer.

Влади

Влади

 

Bash Script for backup

#!/bin/bash
####################################
#
# Backup to NFS mount script with
# grandfather-father-son rotation
# of specified directory
#
####################################
# What to backup.
backup_files="/etc /root"
# Where to backup to.
dest="/backup/system"
# Setup variables for the archive filename.
day=$(date +%A)
hostname=$(hostname -s)
# Find which week of the month 1-4 it is.
day_num=$(date +%d)
if (( $day_num <= 7 )); then
week_file="$hostname-week1.tgz"
elif (( $day_num > 7 && $day_num <= 14 )); then
week_file="$hostname-week2.tgz"
elif (( $day_num > 14 && $day_num <= 21 )); then
week_file="$hostname-week3.tgz"
elif (( $day_num > 21 && $day_num < 32 )); then
week_file="$hostname-week4.tgz"
fi
# Find if the Month is odd or even.
month_num=$(date +%m)
month=$(expr $month_num % 2)
if [ $month -eq 0 ]; then
month_file="$hostname-month2.tgz"
else
month_file="$hostname-month1.tgz"
fi
# Create archive filename.
if [ $day_num == 1 ]; then
archive_file=$month_file
elif [ $day != "Saturday" ]; then
archive_file="$hostname-$day.tgz"
else
archive_file=$week_file
fi
# Print start status message.
echo "Backing up $backup_files to $dest/$archive_file"
date
echo
# Backup the files using tar.
tar czf $dest/$archive_file $backup_files
# Print end status message.
echo
echo "Backup finished"
date
# Long listing of files in $dest to check file sizes.
ls -lh $dest/
[/CODE]

Влади

Влади

×

Important Information

By using this site, you agree to our Terms of Use.