Monday, September 4, 2017

Different things

1. Enable Powershell ISE from Windows Server 2008 R2

 Import-Module ServerManager 
 Add-WindowsFeature PowerShell-ISE
2. Using nslookup from CMD:


Nslookup -querytype=all  google.com NameServer | findstr crk
3. Updating DNS records using Powershell:

Add-DnsServerResourceRecordA -Name "DNS-HOSTNAME" -ComputerName "NAMESERVER" -ZoneName "statoilfuelretail.com" -AllowUpdateAny -IPv4Address "1.1.1.1" 
Remove-DnsServerResourceRecord -ZoneName "statoilfuelretail.com" -RRType "A" -Name "NAME" -ComputerName 1.1.1.1
Add-ADGroupMember groupname "username"
remove-ADGroupMember groupname "username"
Get-ADGroupMember groupname 

New-ADGroup -Path "ou=Groups,ou=NAME,dc=DN_NAME,dc=com" -GroupScope 1 -server SERVERNAME -Name GROUPNAME


Create a structure of folder from another folder with NTFS security setting:
robocopy c:\temp c:\tmp\test1 /zb /e /xf /sec *

Monday, May 8, 2017

how to connect to internal company resource from virtual box on direct access

Issue:
no connection from Virtual box that was provisioned using vagrant to company internal resources while connected there using Direct access.


Solution:
1. Connect to company with DA.
2. Ssh to known linux box inside company with local port forward:


3. Connect to your vagrant box with remote port forward:

 
ssh ubuntu@127.0.0.1 -p 2222 -R 10000:localhost:125 -o LogLevel=ERROR -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -i C:\Jarek\vagrant_hosts\ubuntu_postfix2\.vagrant\machines\default\virtualbox\private_key

Saturday, January 28, 2017

Enabling different features of PI MusicBox.

Enabling different features of PI MusicBox.

1. Fix missing playlists from Spotify:

Comment out string "return" in usr/local/lib/python2.7/dist-packages/mopidy_spotify/session_manager.py

def refresh_playlists(self):
"""Refresh the playlists in the backend with data from Spotify"""
if not self.initialdata_receive_completed:
logger.debug('Still getting data; skipped refresh of playlists')
return
playlists = []
folders = []

2. Enable sound from YouTube:

pip install --upgrade pafy

3. Enable instant play of audio from YouTube:

open the following file for editing in your favorite editor:
/usr/local/lib/python2.7/dist-packages/mopidy/audio/actor.py
remove the download flag from PLAYBIN_FLAGS so only the following options remain:
# Default flags to use for playbin: AUDIO, SOFT_VOLUME
PLAYBIN_FLAGS = (1 << 1) | (1 << 4)
PLAYBIN_VIS_FLAGS = PLAYBIN_FLAGS | (1 << 3)
Save the file and reboot your pi, please note that changing this results in to not being able to seek through the track

Managing Windows power schemes with powercfg

Managing Windows power schemes with powercfg

1. Displaying what is preventing from sleep:

C:\Windows\system32>powercfg -requests
DISPLAY:
[PROCESS] \Device\HarddiskVolume1\Program Files (x86)\Sony\PlayMemories Home\PMBBrowser.exe

SYSTEM:
[PROCESS] \Device\HarddiskVolume1\Program Files (x86)\Sony\PlayMemories Home\PMBBrowser.exe

AWAYMODE:
None.

2. Disabling process that prevents computer going to sleep:

C:\Windows\system32>powercfg /requestsoverride PROCESS PMBBrowser.exe DISPLAY SYSTEM AWAYMODE