This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netstat -an | findstr /C:1158 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
invoke_help() { | |
cat << EOF | |
Usage: $0 -a <ACTION> [-f] [-h] | |
-a : ACTION, where ACTION is one of: | |
start : Start the service in the background | |
stop : Stop the service | |
status : Show status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JMX_OPTS="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote" | |
JMX_OPTS="$JMX_OPTS -Dcom.sun.management.jmxremote.authenticate=false" | |
JMX_OPTS="$JMX_OPTS -Dcom.sun.management.jmxremote.port=1100" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$curl http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost,service=Health | |
{"timestamp":1449776947,"status":200,"request":{"mbean":"org.apache.activemq:brokerName=localhost,service=Health,type=Broker","type":"read"},"value":{"CurrentStatus":"Good"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.define "lb" do |lb| | |
lb.vm.box = "centos65" | |
lb.vm.host_name = "lb" | |
lb.vm.network "private_network", ip: "192.168.0.20" | |
lb.vm.network :forwarded_port, guest: 22, host: 2220, id: "ssh", auto_correct: true | |
lb.vm.network :forwarded_port, guest: 80, host: 9099, id: "web", auto_correct: true | |
config.vm.provider :virtualbox do |vb| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 1000000 | |
IDENTITY(INT,1,1) AS UniqueInt, | |
CAST(NEWID() AS VARCHAR(36)) AS UniqueVarChar | |
INTO #TestTable | |
FROM Master.sys.All_Columns ac1 | |
CROSS JOIN Master.sys.All_Columns ac2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- DO NOT RUN this script on Production environment | |
-- Clear the plan cache | |
dbcc freeproccache | |
-- Look at the cached query plans | |
select st.text,* | |
from sys.dm_exec_cached_plans cp | |
cross apply sys.dm_exec_sql_text(cp.plan_handle) st | |
where (st.text like '%select * from Person.Address%') | |
and st.text not like '%select st.text%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Source: http://simplesqlserver.com/2013/11/20/indexing-fundamentals/ | |
DECLARE @TableName VarChar(100) | |
SELECT @TableName = '%' | |
SELECT TableName = i.SchemaName + '.' + i.TableName | |
, IndexName = ISNULL(i.IndexName, '[' + Lower(i.IndexType) + ']') | |
--, SeekUpdateRatio = CASE WHEN i.User_Updates > 0 THEN CAST(i.User_Seeks / CAST(i.User_Updates as DEC(20,1)) as DEC(20,2)) ELSE 0 END | |
, i.User_Updates | |
, i.User_Seeks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
OBJECT_NAME(ind.OBJECT_ID) AS TableName, | |
ind.name AS IndexName, | |
indexstats.index_type_desc AS IndexType, | |
indexstats.avg_fragmentation_in_percent | |
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, NULL) indexstats | |
INNER JOIN sys.indexes ind ON ind.object_id = indexstats.object_id AND ind.index_id = indexstats.index_id | |
WHERE indexstats.avg_fragmentation_in_percent > 30--You can specify the percent as you want | |
ORDER BY | |
indexstats.avg_fragmentation_in_percent DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SCHEMA_NAME(schema_id) AS SchemaName, | |
OBJECT_NAME(o.object_id) AS ObjectName, | |
type AS ObjectType, | |
s.name AS StatsName, | |
STATS_DATE(o.object_id, stats_id) AS StatsDate | |
FROM sys.stats s | |
INNER JOIN sys.objects o ON o.object_id=s.object_id | |
WHERE OBJECTPROPERTY(o.object_id, N'ISMSShipped') = 0 | |
AND LEFT(s.Name, 4) != '_WA_' |
NewerOlder