ersinakyuz.com
msgbartop
just my personal notebook…
msgbarbottom


07 Jan 16 How to troubleshoot memory issues when executing remote Powershell queries

If you are receiving “Processing data for a remote command failed with the following error message: The WSMan provider” message from the PS Queries (e.g. on the Nagios)

All you have to do is log on the target computer, and run powershell with Administrator Rights. Then you can increase Powershell memory with below commands

You can get current memory size with get-item:

Get-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB

 

And here is the command for change the value:

Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 250 -Force

or

winrm set winrm/config/winrs @{MaxMemoryPerShellMB=”512″}

 

powershellmemory

 

In some cases, you need to restart the WinRM service on target system:

Restart-Service winrm

06 Jan 16 best editor for golang

I was looking for a good (and free) GoLang IDE. Then I found fully opensource LITEIDE. It supports code completion and syntax highlighting. Also has a debugger which running in background.

You can download it from below link:
http://code.google.com/p/golangide/

goliteide

18 Dec 15 Catching Out Of Memory Exceptions in PowerShell

Catch [System.OutOfMemoryException]{
     bla bla bla...
 }

14 Dec 15 How to resize linux logical volume (lvm) in a virtualbox vm

I was installed Fedora VM in to 8 GB Virtual Disk (vdi) but now I need to resize disk to 16 GB

VBoxManage modifyhd “D:\VirtualBox VMs\Fedora\Fedora.vdi” –resize 16384

 

Now the linux part.

You’d have to unmount it to shrink it (which requires a LiveCD / Rescue Mode.)

  1. pvresize /dev/sda2 (assuming your LVM partition is sda2. Replace as required.)
  2. lvextend /dev/mapper/root -l+100%FREE  (or, whatever your root logical volume is called.)
  3. resize2fs /dev/mapper/root (assuming ext2/3/4)

30 Nov 15 Installing Powershell ISE via Powershell commands

Using PowerShell

  1. Open Powershell Window
  1. Execute following cmdlets.
Import-Module ServerManager

Add-WindowsFeature PowerShell-ISE

Tags:

29 Aug 15 raspberry pi released 5$ model raspberry pi zero!

 

image

 

Raspberry Pi Zero has released out this week. It’s not powerful as Raspberry Pi 2. However  specs is so good for 5$ computer.

  • 1Ghz, Single-core CPU (Broadcom BCM2835 ARMv6 SoC full HD  processor)
  • 512MB 400 MHz RAM
  • Mini HDMI and USB On-The-Go ports
  • Micro USB power
  • HAT-compatible 40-pin header
  • Composite video and reset headers

Comparison with a playing card
kd9nfntpa3i8g5tgj59c

 

For more information : https://www.raspberrypi.org/blog/raspberry-pi-zero/

 

12 Aug 15 Replace a String in Multiple Files in Linux Using Grep and Sed

Example
grep -rl 'old-string' ./ | xargs sed -i 's/old-string/new-string/g'

This will search for the string ‘old-string’ in all files relative to the current directory and replace ‘old-string’ with ‘new-string’ for each occurrence of the string in each file.

28 Apr 15 How to connect Oracle DB with PowerShell

# Load the ODP assembly 
[Reflection.Assembly]::LoadFile("C:\oracle\11.2.0\client_2\odp.net\bin\4\Oracle.DataAccess.dll")|Out-Null
# 
#vars&cons
$stations =@{
"424"="Istanbul";
"421"="İzmir"
}
$dbuser="user"
$dbpasswd="password"

connect to Oracle


$constr =
"
User Id=$dbuser;
Password=$dbpasswd;
Data Source=CITIES
"
$conn= New-Object Oracle.DataAccess.Client.OracleConnection($constr)
$conn.Open()

Create a datareader for a SQL statement

$sql="select stationid
from CITIES.SWITCHPARAMETER
where switchid = '2'
"
$command = New-Object Oracle.DataAccess.Client.OracleCommand( $sql,$conn)
$reader=$command.ExecuteReader()

Write out the results

# 
while ($reader.read()) {
$stationID=$reader.GetString(0)
$stationname=$stations.Get_Item($stationID)
Write-Host
"
Station ID: $stationID ($stationname)"
}

Tags: ,

14 Oct 14 finding last edited file on unix CLI

to find last edited file in a folder on unix CLI:

`ls -1t | head -1`

to edit the file:

more `ls -1t | head -1`

15 Apr 14 Amazon Kindle WhitePaper II hakkında

DSC_0933 DSC_0934 DSC_0936DSC_0937DSC_0938 DSC_0939   DSC_0928 DSC_0932

Uzun zaman araştırdıktan sonra bir e-book reader almaya karar verdim. Piyasada araştırdığım modeller arasında Nook ve kindle öne çıkıyordu. Bunun dışında ucuz diyebileceğimiz reeder gibi markalar da vardı. reeder’a baktığımda çözünürlük ve genel olarak kalitesinin beni tatmin etmeyeceğini gördüm. Geriye kindle ve Nook  kalmıştı. Pek çok blog’u inceledikten sonra (idyllicmserdark, büyükkeyif)  arka aydınlatmaya  sahip olan Nook Glow ve kindle Whitepaper arasında kindle Whitepaper II dan yana seçim yaptım.

Tercihime neden olan etkenler;

1. Arka ışıklandırmaya sahip olması
2. Kağıda çok yakın görüntü kalitesi
3. Amazon.com gibi bilinen bir markete sahip olması
4. Kullanılan malzemenin kalitesiydi.

Bir aylık kullanımın ardından yorumlarım ise şöyle;

Pil kullanımı gerçekten şaşırtıcı; arada dosya aktarmak için PC’ye bağlamam dışında şarj etmiyorum. Çeşitli yerlerde şarj edilmeden bir ay çalışabileceği yazıyordu. Bazı bloglarda reklamların amazon helpdesk ile görüşülerek kaldırılabileceğinden bahsetmişler ancak ben reklamlarda herhangi bir rahatsız edici yan göremedim. Cihaz kapalıyken ekran koruyucu kipinde ve açıkken de altta ufak bir çubuk şeklinde kitap reklamları çıkıyor.

Wifi ile internete bağlanabilen cihazın “experimental” bir web tarayıcısı var. Bir tablet kadar pratik olmasa da pek çok sitede, özellikle de mobil sitelerde hiç zorlanmadığını gördüm.

Cihazda herhangi bir ses çıkışı yok. Daha önceki versiyonlarda varmış. Eksikliğini hissetmedim.

Sözlük özelliği çok pratik. Yabancı dilde bir kelime üzerine dokunup beklediğinizde Oxford sözlük belirip anlamını veriyor. (sonradan şu adresten TR-ENG sözlük bulup yükledim)

Highlight özelliği ise altını çizmeniz not almanız gereken yerlerde yardımcı oluyor. Daha sonra altını çizdiğiniz bölümlere kolayca ulaşabiliyorsunuz.

Popüler e-kitap formatlarından .mobi ve .azw3 formatlarını tanıyan cihaz .epub formatını okumuyor. Bunun için  Calibre adlı yazılımla dosyayı .mobi’ye dönüştürmek gerekiyor. Tanıdığı tüm formatlar : AZW3,  AZW, TXT, PDF, MOBI, PRC, HTML, DOC,DOCX, JPEG, GIF, PNG. Ancak PDF formatındaki belgeleri okumak için çok uygun olduğunu söyleyemeyeceğim.

Normal kitapların korunması açısından geleneksel kitapları dostlarıma ve sevdiklerime hediye edip, normal kitaplığımı da “hard-cover” kitaplarla donatmaya çalışıyorum. Elbette ki Sabahattin Ali’yi güzel ciltli bir kitaptan okumayı kindle’a her zaman tercih ederim!

DSC_1087