If you try to upgrade linux distribution (for example from 14.04 to 16.04) sometimes upgrade fail because of no free space at /boot partition. This happens because there are old kernel installed that are no longer needed. To remove old kernel you shoul issue command like this:
sudo apt-get purge linux-image-x.x.x-xx-generic
where "x" are numbers. so you remove all kernels except one that is used. ( check it with uname -r command). Usually in /boot partition there are many of kernels, so removing them one by one is time consuming operation. To make it more convenient use that crazy long command and wait :)
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
It remove all unused kernels from your /boot partition.
Wednesday, October 19, 2016
Thursday, October 13, 2016
How to check your "external" ip from command line.
Sometimes when you are behind the NAT you need to know what is your "external" IP address.
You can check it from browser(for ex. http://whatismyip.org), but what if you have only command line? Just type in these lines:
nslookup myip.opendns.com. resolver1.opendns.com
do not forget dot "." after first host.
You can check it from browser(for ex. http://whatismyip.org), but what if you have only command line? Just type in these lines:
nslookup myip.opendns.com. resolver1.opendns.com
do not forget dot "." after first host.
Thursday, October 6, 2016
Install x11vnc on xubuntu 16.04 for remote access
Tight VNC server opens new session, but if you need to connect to active session(like in teamviewer when user see what you are doing) I suggest to install x11vnc.
Installation process as follows:
sudo apt-get install x11vnc -y
next - specify password for remote connections:
sudo x11vnc -storepasswd /etc/x11vnc.pass
now create service unit file:
sudo touch /lib/systemd/system/x11vnc.service
and open it in editor:
sudo nano /lib/systemd/system/x11vnc.service
paste to file:
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
now configure service:
sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
now reboot and try to connect to x11vnc.
Installation process as follows:
sudo apt-get install x11vnc -y
next - specify password for remote connections:
sudo x11vnc -storepasswd /etc/x11vnc.pass
now create service unit file:
sudo touch /lib/systemd/system/x11vnc.service
and open it in editor:
sudo nano /lib/systemd/system/x11vnc.service
paste to file:
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
now configure service:
sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
now reboot and try to connect to x11vnc.
Wednesday, September 28, 2016
How to change product key in Office 2016.
There is no option to change product key in "Add/Remove programs" trough control panel.
Instead of using Control Panel, run command prompt with administrative privileges and run following commands:
to check key status:
For Office 2016 32bit on 32bit version of Windows
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus
For Office 2016 32bit on 64bit version of Windows
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /dstatus
For Office 2016 64bit on 64bit version of Windows
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus
you'll get installed license details and last 5 character of Product Key.
you can change product key by entering command /inpkey:value for example:
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Instead of using Control Panel, run command prompt with administrative privileges and run following commands:
to check key status:
For Office 2016 32bit on 32bit version of Windows
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus
For Office 2016 32bit on 64bit version of Windows
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /dstatus
For Office 2016 64bit on 64bit version of Windows
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus
you'll get installed license details and last 5 character of Product Key.
you can change product key by entering command /inpkey:value for example:
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Friday, September 23, 2016
Exchange 2013. Got error 500 when try to login to ECP.
Problem: when trying to access exchange control panel, after entering credentials server returns error 500. If you look to event viewer you find the errors like this:
System.InvalidOperationException: Cannot load Counter Name data because an invalid index 'W3SVC_W3WP' was read from the registry.
Login to OWA is working normally.
Solution: On server run command prompt with administrative privilegies and run command:
lodctr /R
If you get an error, try to run again. After it finished with success, restart IIS with command
iisrestart
After that try to login to ECP.
System.InvalidOperationException: Cannot load Counter Name data because an invalid index 'W3SVC_W3WP' was read from the registry.
Login to OWA is working normally.
Solution: On server run command prompt with administrative privilegies and run command:
lodctr /R
If you get an error, try to run again. After it finished with success, restart IIS with command
iisrestart
After that try to login to ECP.
Friday, September 2, 2016
Exchange 2013. Add mailbox from powershell.
Check database name:
Get-MailBoxDatabase
for existing user mailenable it:
Enable-Mailbox estherv@contoso.com -Database UsersMailboxDatabase
if you create new user:
New-Mailbox -Alias pilarp -Name "Pilar Pinilla" -FirstName Pilar -LastName Pinilla -DisplayName "Pilar Pinilla" -UserPrincipalName pilarp@contoso.com -Password (ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force)
add additional email addresses if needed:
Set-Mailbox "Tom Taylor" -EmailAddresses @{add="tomt@acme.com","tom.taylor@acme.com"}
choose default reply to address:
Set-Mailbox "Tom Taylor" -PrimarySmtpAddress tom.taylor@acme.com
if mailbox is configured to use an email address policy then you shoul disable it first(before doing previous step):
Set-Mailbox "Tom Taylor" -EmailAddressPolicyEnabled $false
check is user created:
Get-Mailbox <Name> | FL Name,RecipientTypeDetails,PrimarySmtpAddress
check what distribution group configured
Get-DistributionGroup
Add mailbox to distribution group
Add-DistributionGroupMember -Identity "Staff" -Member "tomtaylor@acme.com"
Get-MailBoxDatabase
for existing user mailenable it:
Enable-Mailbox estherv@contoso.com -Database UsersMailboxDatabase
if you create new user:
New-Mailbox -Alias pilarp -Name "Pilar Pinilla" -FirstName Pilar -LastName Pinilla -DisplayName "Pilar Pinilla" -UserPrincipalName pilarp@contoso.com -Password (ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force)
add additional email addresses if needed:
Set-Mailbox "Tom Taylor" -EmailAddresses @{add="tomt@acme.com","tom.taylor@acme.com"}
choose default reply to address:
Set-Mailbox "Tom Taylor" -PrimarySmtpAddress tom.taylor@acme.com
if mailbox is configured to use an email address policy then you shoul disable it first(before doing previous step):
Set-Mailbox "Tom Taylor" -EmailAddressPolicyEnabled $false
check is user created:
Get-Mailbox <Name> | FL Name,RecipientTypeDetails,PrimarySmtpAddress
check what distribution group configured
Get-DistributionGroup
Add mailbox to distribution group
Add-DistributionGroupMember -Identity "Staff" -Member "tomtaylor@acme.com"
Wednesday, August 24, 2016
How to turn on "save as..." prompt on Microsoft Edge browser
I really miss the "save as" prompt in Microsoft edge browser. By default it just start to download file without asking where i want to save it. By default it save file to user's profile "download" directory, but what to do if you have no space on that drive and need to download large file? Fortunately there are solution.
- Open command prompt or press "win"+r keys.
- Type in "regedit" and press "enter".
- Navigate to key HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\
- If there no "Download" key create it.
- Navigate to Download key and create DWORD value "EnableSavePrompt"
- Assign value "1" if you want "Save As..." prompt or "0" to turn off.
Subscribe to:
Posts (Atom)