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/bash -ex | |
perl -pi -e 's/^#?Port 22$/Port 2222/' /etc/ssh/sshd_config | |
service sshd restart || service ssh restart |
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
var selfDestructMessage = function(element) { | |
// Do some stuff | |
selfDestructMessage = function(element) { /* Replace myself with an empty block */ } | |
}; |
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
/* | |
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* - Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* |
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
### LIST users | |
userCount = com.liferay.portal.service.UserLocalServiceUtil.getUsersCount(); | |
users = com.liferay.portal.service.UserLocalServiceUtil.getUsers(0, userCount); | |
users.each{ |user| $out.print user.getFullName() + "\n"} | |
userCount = com.liferay.portal.service.UserLocalServiceUtil.getUsersCount(); | |
users = com.liferay.portal.service.UserLocalServiceUtil.getUsers(0, userCount); | |
users.each{ |user| $out.print user.toString()+ "\n" } | |
### UPDATE user properties |
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
/** | |
* Remember to clear the previous refreshId before setting a new one. IE, in particular, will not remove the prior id automatically. | |
*/ | |
var defaultRefreshInterval = 5; // minutes | |
var url = window.location.protocol + '//' + document.domain; | |
var refreshId; | |
var enableAutoRefresh = function() { | |
var interval = jQuery('#autorefresh_interval').val(); | |
var enabled = jQuery('#enable_autorefresh').is(':checked'); |
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
Object.prototype.getName = function() { | |
var funcNameRegex = /function (.{1,})\(/; | |
var results = (funcNameRegex).exec((this).constructor.toString()); | |
return (results && results.length > 1) ? results[1] : ""; | |
}; |
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
# show any ghost/phantom resources that could still be affecting df but have been deleted | |
lsof +L 1 /home | grep -i deleted | |
# hog | |
du -sk * | |
# add up the hogs | |
du -sk * |sort -n| awk {'print $1'}| paste -sd+| bc | |
# use date to get the date 30 days ago |
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
Ordering<Item> o = new Ordering<Item>() { | |
@Override | |
public int compare(Item left, Item right) { | |
return Ints.compare(left.getValue(), right.getValue()); | |
} | |
}; | |
return o.max(listOfItem); |
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
@REM store user credentials | |
@REM setDomainEnv.cmd only seems to work when you are in the same PWD | |
C:\Oracle\middleware\user_projects\domains\base_domain\bin>setDomainEnv.cmd | |
C:\Oracle\middleware\user_projects\domains\base_domain>java weblogic.WLST | |
wls:/offline> connect ('myUserid','myPassword','t3s://localhost:7001'); | |
wls:/CLUSTERNAME/serverConfig> storeUserConfig(userConfigFile='wls.local.config', userKeyFile='wls.local.key'); | |
@Deploying with maven weblogic plugin | |
mvn weblogic:wlst -nsu -Penv-local -DfileName=etc\redeploy.py -DfailOnError=false -Dargs="${wls.userConfigFile} ${wls.userKeyFile} ${wls.adminurl}" |
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
$name = "myVM" | |
$acl1 = New-AzureAclConfig | |
$vm = Get-AzureVM -ServiceName $name -Name $name | |
Set-AzureAclConfig -AddRule -ACL $acl1 -Order 100 -Action permit -RemoteSubnet "X.X.0.0/16" -Description "rule1" | |
Set-AzureAclConfig -AddRule -ACL $acl1 -Order 200 -Action permit -RemoteSubnet "X.X.0.0/16" -Description "rule2" | |
$vm | Get-AzureEndpoint | ForEach-Object {Set-AzureEndpoint -ACL $acl1 -Nam | |
e $_.Name -VM $vm} |
OlderNewer