web analytics

Shit my brain says and forgets

How to Add Package Control for Sublime Text 3

Let’s add Package Control to Sublime Text 3.

package control sublime text 3 add install

Easy Install

The easiest way to install is through Sublime Text console. The console can be found by typing ctrl+` (Mac keyboard ^`) or from View > Show Console. Console should open at bottom with a field to input characters. Now you can paste the following Python code there and press enter:

import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

More from packagecontrol.io

This code creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it. The download will be done over HTTP instead of HTTPS due to Python standard library limitations, however the file will be validated using SHA-256.

Manual Install

If you would rather manually install Package Control for Sublime Text 3 that can be done too!

  • Go to Sublime Text > Preferences > Browse Packages
  • This will open a Finder window to /Users/jack/Library/Application Support/Sublime Text 3/Packages/
  • Move up a /Users/jack/Library/Application Support/Sublime Text 3 and then into Installed Packages/
  • Download Package Control.sublime-package from packagecontrol.io and place the file in the current directory.
  • Restart Sublime Text 3.

How to Configure Network Interfaces in CentOS Add Second NIC

Within CentOS, RHEL or Fedora you can configure your network interfaces by using configuration files located in /etc/sysconfig/network-scripts/. For each network interface say eth0 or eth1 there should be a corresponding configuration file such as ifcfg-eth0 or ifcfg-eth1 in the directory. Check out the directory yourself.

cd /etc/sysconfig/network-scripts
ll

Alt text

You can see here there is a configuration file for eth0 named ifcfg-eth0. Let’s check it out.

cat ifcfg-eth0

# cat ifcfg-eth0
DEVICE="eth0"
BOOTPROTO=dhcp
NM_CONTROLLED="no"
PERSISTENT_DHCLIENT=1
ONBOOT="yes"
TYPE=Ethernet
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME="eth0"

This config is for a DHCP interface.
Here is a static assignment interface configuration:

# cat ifcfg-eth0
DEVICE="eth0"
HWADDR="00:21:70:10:7E:CD"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=static
# BOOTPROTO=dhcp
IPADDR=10.18.1.203
NETMASK=255.255.255.0
#
#   the GATEWAY is sometimes in: /etc/sysconfig/network
GATEWAY=10.16.1.1

Then common items such as the DNS servers and hostname may be optionally added in /etc/sysconfig/network

# cat /etc/sysconfig/network
HOSTNAME=jack.test.com
DNS1=10.18.1.203
DNS2=8.8.8.8
## DNS2=4.2.2.2
SEARCH=test.com

So, to create second interface of a static IP let’s do this:
nano ifcfg-eth1 or nano /etc/sysconfig/network-scripts/ifcfg-eth1 if you are not in network-scripts directory.
Paste your configuration and change network info to your needs:

DEVICE="eth1”
HWADDR="00:21:70:10:7E:CD"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=static
# BOOTPROTO=dhcp
IPADDR=10.18.1.203
NETMASK=255.255.255.0
GATEWAY=10.16.1.1

Save file.
Once you are all set with your configurations restart the network service:
service network restart

# service network restart
Shutting down interface eth0:                  [  OK  ]
Shutting down interface eth1:                  [  OK  ]
Shutting down loopback interface:              [  OK  ]
Bringing up loopback interface:                [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.
                                               [  OK  ]
Bringing up interface eth1:
Determining IP information for eth1... done.
                                               [  OK  ]

Running ifconfig will show you what your current network information is now.

ifconfig
eth0      Link encap:Ethernet  HWaddr 02:55:12:78:50:1d
          inet addr:10.18.1.15  Bcast:10.18.1.255  Mask:255.255.255.0
          inet6 addr: fe80::1c73:bcff:fe62:f075/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6648 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4798 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1159836 (1.1 MiB)  TX bytes:1624933 (1.5 MiB)
          Interrupt:160

eth1      Link encap:Ethernet  HWaddr ca:2c:49:10:2e:d4
          inet addr:10.19.1.154  Bcast:10.19.1.255  Mask:255.255.255.0
          inet6 addr: fe80::c82c:49ff:fe10:2ed4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1863 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2373 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:612953 (598.5 KiB)  TX bytes:328246 (320.5 KiB)
          Interrupt:159

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2773 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2773 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:759142 (741.3 KiB)  TX bytes:759142 (741.3 KiB)

Add a Second Network to Ubuntu

Edit /etc/network/interfaces

This will create a static IP on eth1.
Add the following while changing the IP address and netmask to your liking:

auto eth1
iface eth1 inet static
address 10.101.1.3
netmask 255.255.255.0
mtu 1450

Setting Up a New User on a New Ubuntu Server

Initial Setup of a Ubuntu Server 14.04, 15.04

Step One — Root Login

ssh root@SERVER_IP

Step Two — Create a New User

adduser frank

Step Three — Set Root Privileges

gpasswd -a frank sudo

Step Four — Add Public Key Authentication

For Mac OS X

If you do not have a SSH key pair then you will have to generate a new one.
ssh-keygen
Files that are created:
/Users/localuser/.ssh/id_rsa # private key / passphrase protected
/Users/localuser/.ssh/id_rsa.pub # public key
Enter a passphrase and save this password.

Manually Install the Key

Locally
cat ~/.ssh/id_rsa.pub
copy key
On the server
su - frank
mkdir .ssh
chmod 700 .ssh
nano .ssh/authorized_keys
Type CTRL+O to save as that file name. Enter
To exit nano type CTRL+X. Also you can CTRL+X and Y to exit the file and save when prompted.
chmod 600 .ssh/authorized_keys
exit
Exit as frank to go back to root user.

Step Five — Configure SSH Daemon

nano /etc/ssh/sshd_config
Find
PermitRootLogin yes
Change to
PermitRootLogin no
CTRL+X Y Enter

Step Six — Reload SSH and Test

service ssh restart

Add-KdsRootKey – Error “The Process cannot access the file because it is being used by another process…”

I’ve been attempting to use the command New-ADServiceAccount in PowerShell to set up Managed Service Accounts but I always end up with an error in the end. I then found out that there needs to be a KDS root key. Next I found this website which stated to Add-KdsRootKey –EffectiveTime ((get-date).addhours(-10)); I was given this error:

Add-KdsRootKey : The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

Add-KdsRootKey : The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

 

To fix this Add-KdsRootKey error some more steps needed to be taken to verify proper setup.

On the Domain Controller go to Active Directory Sites and Services (dssite.msc).

Active Directory Sites and Services

 

Go to View and enable Show Services Node option.

Show Service Nodes - Active Directory Sites and Services

 

Then on the left pane open Services > Group Key Distribution Service > Server Configuration node.

Group Key Distribution Services

 

There should be an object named “Group Key Distribution Service Server Configuration” within this node. If it exsists then you are almost there getting this sucker working. As stated from dirteam.com, in order for the Group Key Distribution Service to operate it will need root keys. Well I have done this and I get the error that has likely brought you here. Further reading, in the Master Root Keys if there is no object you are to run Add-KdsRootKey -EffectiveImmediately command.

Master Root Keys


More research has found
that the process is looking for Domain Controllers in the “Domain Controllers” container withing Active Directory. It appears that only one DC running the relevant operating system needs to be in the root of the Domain Controllers container.

Now the command “Add-KdsRootKey –EffectiveTime ((get-date).addhours(-10));” will run without a hitch. I have only a few DCs so running the command now rather than the normal 10 hours is what I chose here. No idea of the Guid needs to be secret or not.

add-kdsrootkey -effectivetime

 

Now I can run my original command “New-ADServiceAccount -Name SQL2012STsvc -DNSHostName “dc1” -Path “cn=Managed Service Accounts, dc=omg,dc=com” -enabled $true”

References
TechNet – addkdsrootkey failing with the process cannot access the filearchive.is
dirteam.comarchive.is
trevorsullivan.netarchive.is