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} |
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
public class PreferredBuilder { | |
private String a; | |
private int i; | |
public PreferredBuilder() { | |
} | |
public PreferredBuilder(Builder builder) { | |
this.a = builder.a; |
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
-- Personal preference for unpivot | |
SELECT | |
SUBSTR(CLMN, 0, INSTR(CLMN,'_TOTAL_FROM', 1, 1)-1) AS COLOR, COUNT, COUNT/TOTAL*100 || '%' AS PCT, TOTAL, FROM_DATE, TO_DATE | |
FROM ( | |
WITH SUMMARY AS | |
(SELECT | |
TO_DATE('2015-09-28','YYYY-MM-DD') AS FROM_DATE, TO_DATE('2015-10-01','YYYY-MM-DD') AS TO_DATE, 100000 AS TOTAL, 90000 AS BLUE, | |
5000 AS RED,3000 AS GREEN,0 AS YELLOW | |
FROM DUAL) | |
SELECT * FROM SUMMARY |
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
/** | |
* 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
### 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
# 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
@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
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
keytool -importkeystore -srckeystore "source-keystore.jks" -destkeystore "destination-keystore.jks" -srcstorepass password -deststorepass password -srcalias "alias" |
OlderNewer