Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Wright discoposse

View GitHub Profile
@discoposse
discoposse / gist:8791513
Created Feb 3, 2014
Is this a subquery I need?
View gist:8791513
people table fields:
id,first_name,last_name,login,manager_id
I need to get all the info, plus the login of the manager where manager_id references the record in the people table.
This is why I'm not a DBA
View gist:2a70427c77a6b02dae33
Out of the box build - command is "ceilometer meter-list"
results:
root@controller:/var/log/ceilometer# cat ceilometer-agent-central.log
2015-05-11 14:58:18.283 24053 ERROR ceilometer.agent [-] Unable to discover resources: 'AuthorizationFailure' object has no attribute 'tenants'
2015-05-11 14:58:18.283 24053 TRACE ceilometer.agent Traceback (most recent call last):
2015-05-11 14:58:18.283 24053 TRACE ceilometer.agent File "/usr/lib/python2.7/dist-packages/ceilometer/agent.py", line 233, in discover
2015-05-11 14:58:18.283 24053 TRACE ceilometer.agent discovered = discoverer.discover(self, param)
2015-05-11 14:58:18.283 24053 TRACE ceilometer.agent File "/usr/lib/python2.7/dist-packages/ceilometer/central/discovery.py", line 61, in discover
View PowerShell - Get a list of "old" computers in Active Directory
# Requires ActiveRoles CmdLets from Quest Software (They're free and awesome) - http://www.quest.com/powershell/activeroles-server
$old = (Get-Date).AddDays(-60) # Modify the -60 to match your threshold
Get-QADComputer -IncludedProperties pwdLastSet -SizeLimit 0 | where { $_.pwdLastSet -le $old }
@discoposse
discoposse / gist:1183443
Created Aug 31, 2011
Move Windows 7 Active Directory Computers based on IP Address
View gist:1183443
################################################################################
# PowerShell routine to move Windows 7 Computers into OU structure based on IP #
################################################################################
#####################
# Environment Setup #
#####################
#Add the Quest PowerShell snapin
Add-PsSnapIn Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
@discoposse
discoposse / C2OS-Error-on-Windows-with-vagrant
Created Jul 24, 2013
This is the install log during the vagrant deployment on a Windows host running Virtual Box
View C2OS-Error-on-Windows-with-vagrant
PS C:\users\ewright\Documents\VirtualBoxProjects\Couch_to_OpenStack> vagrant up
Bringing machine 'controller' up with 'virtualbox' provider...
[controller] Importing base box 'precise64'...
←[0K[controller] Matching MAC address for NAT networking...
[controller] Setting the name of the VM...
[controller] Clearing any previously set forwarded ports...
[controller] Fixed port collision for 22 => 2222. Now on port 2200.
[controller] Creating shared folders metadata...
[controller] Clearing any previously set network interfaces...
[controller] Preparing network interfaces based on configuration...
@discoposse
discoposse / C2OS - vagrant error starting at compute node
Created Aug 15, 2013
This is the vagrant output for Windows. The first node loads fine, but the common.sh borks on the Compute node and the rest of the build fails
View C2OS - vagrant error starting at compute node
PS C:\users\ewright\Documents\GitHub\Couch_to_OpenStack> vagrant up
Bringing machine 'controller' up with 'virtualbox' provider...
Bringing machine 'compute' up with 'virtualbox' provider...
Bringing machine 'cinder' up with 'virtualbox' provider...
Bringing machine 'quantum' up with 'virtualbox' provider...
Bringing machine 'client' up with 'virtualbox' provider...
[controller] Importing base box 'precise64'...
←[0K[controller] Matching MAC address for NAT networking...
[controller] Setting the name of the VM...
[controller] Clearing any previously set forwarded ports...
@discoposse
discoposse / rancher-compose.yml
Created Nov 13, 2015
GlusterFS Rancher Compose sample
View rancher-compose.yml
.catalog:
name: "GlusterFS"
version: "3.7.5-rancher1"
description: "Gluster FS (3x) replicated volume"
uuid: glusterfs-0
questions:
- variable: "VOLUME_NAME"
description: "Name to give the Gluster volume"
label: "Volume Name"
required: true
View PowerShell - Finding users with password expiry in under 14 days and sending an email reminder
# Requires ActiveRoles CmdLets from Quest Software (They're free and awesome) - http://www.quest.com/powershell/activeroles-server.aspx
Get-QADUser -SizeLimit 0 | Select-Object samAccountName,mail,PasswordStatus |
Where-Object {$_.PasswordStatus -ne "Password never expires" -and $_.PasswordStatus -ne "Expired" -and $_.PasswordStatus -ne "User must change password at next logon." -and $_.mail -ne $null} |
ForEach-Object {
$today = Get-Date
$logdate = Get-Date -format yyyyMMdd
$samaccountname = $_.samAccountName
$mail = $_.mail
$passwordstatus = $_.PasswordStatus
$passwordexpiry = $passwordstatus.Replace("Expires at: ","")
View Bulk Green Circle User Follow using Jive API
#!/bin/bash
# USERID is the starting number for the users to follow
# LASTUSER is your upper bound user ID number
# JIVEUSER is your Jive username
# JIVEPASS is your plaintext password
USERID=38000
LASTUSER=38010
JIVEUSER=
@discoposse
discoposse / gist:39045a714249ca7f771c
Created Jun 3, 2014
Delete and Rebuild Keystone database
View gist:39045a714249ca7f771c
# Log in to MySQL command line as root
drop database keystone;
create database keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'KEYSTONE_DBPASS';
exit
# now from the shell
sudo su -c "keystone-manage db_sync" keystone