Posts

amazon web services - Retrieving Username from CloudTrail logs for RunInstances event -

we have large number of ec2 instances running in aws 1 year. trying perform clean activity unused instances , based on username using have launched instances. i have tried downloading cloudtrail logs s3 bucket , tried filtering username , 'runinstances' event may find user launched instance , instance details. the following script used download cloudtrail logs single folder, unzip them , filter instances 'runinstances' event , give count of instances. i need on retrieving usernames each log wiht 'runinstances' event , stopping instances. my script: #!bin/sh s3url="s3://s3bucket/awscloudtraillogs/<accountno>/cloudtrail/region/2016/" (( i=1; i<=12; i++ )) (( j=1; j<=31; j++ )) if [[ $i -le 9 && $j -le 9 ]] aws s3 cp $s3url/0$i/0$j/ ~/test/ --recursive elif [[ $i -le 9 && $j -ge 10 ]] aws s3 cp $s3url/0$i/$j/ ~/test/ --recursive elif [[ $i -ge ...

excel - If function for cell contents -

i'm trying check if content range true, perform function. sheets(1).[a1:a95] if .cells.value = "text" 'perform function end if end but i'm getting type mismatch error. please. if trying check each cell in range whatever testing then, try way. dim ccell range each ccell in sheets(1).range("$a$1:$a$95") 'to test ensure ccell.value expect(can remove once working) debug.print ccell.value if ccell.value ="whateveryouwanttotestfor" 'call function here call myfunction end if next ccell to test multiple values of ccell use select case for each ccell in sheets(1).range("$a$1:$a$95") select case ccell.value case "text1" call text1function case "text2" call text2function 'do rest need end select next ccell

java - integrating email with Oracle Database -

i'm trying integrate oracle xe (11g) email (on linux). includes sending , receiving complete email, receiving attachments , loading them oracle. specifically, i'm looking linux command line email client read emails regularly pop3 or imap mailbox, load email , attachment table tables in oracle xe database. i've seen solution using database java, oracle xe not have java subsystem enabled (and doesn't handle attachments). the alternative using fetchmail, , procmail along sql*loader load emails database, have worked out how monitor email address , extract individual attachments received email, can't work out how extract email body single file, if can correct .procmailrc configuration. thanks

java - How can I fix the column width? -

Image
now width of each row changing depending on size of text. fixed size each column excel. should changed? shouldn't match_parent since parent has large width.. <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <textview android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/text_margin" android:textappearance="?attr/textappearancelistitem" /> <textview android:id="@+id/email" android:layout_width="wrap_content" android:layout_height="wrap_conte...

php - Removing duplicated values from two-dimensional array -

i want remove duplicated values two-dimensional array. i have used array_unique function two-dimensional array. , seems function not work two-dimensional array. any suggestion or appreciated. thank in advance. here array output below: array ( [0] => array ( [is_hide] => 0 [key] => lho0vtlsfci7wwq2ewqy1nup5u13pxwlxt8s0775 ) [1] => array ( [is_hide] => 0 [key] => gisklozxrhxtmhklaeempuwojms08ftweencmrpk ) [2] => array ( [is_hide] => 0 [key] => lho0vtlsfci7wwq2ewqy1nup5u13pxwlxt8s0775 ) ) you can use php's array_map() function: $input = array_map("unserialize", array_unique(array_map("serialize", $input))); see this example .

How to set a specific destination directory when install a package using installpkg tool of slackware -

i trying make package , install in slackware os. package has binary executable file. have created package .tgz file using makepkg tool. when tried install package using installpkg tool binary file extracted root directory. how can change destination directory other location (like /usr/bin). what use of doinst.sh script in package.can write own script in it? thanks make temporary directory make tree structure of installed files make install/ directory 'slack-desc' file , (optional) 'doinst.sh' run makepkg /tmp/package-name-version-arch-build_tag.txz # mkdir /tmp/pkg; cd /tmp/pkg # mkdir -p usr/bin # cp /path/to/your/file usr/bin/ # chmod a+x usr/bin/file # mkdir install # cat <<eof >install/slack-desc appname: appname (short description of app) appname: appname: long description of appname, wrapped @ 71 characters *after* appname: colon following "appname" (and 'handy ruler' should start @ appname: colon , 71 characters ...

javascript - jQuery text() inside .getJSON() -

this question has answer here: $getjson , loop issue 4 answers i'm trying names pokemon api , putting div field in html, .text() function jquery doesn't seem place text html when put inside .getjson function. curious problem be? thanks. <div class="container"> <div class="row"> <div class="col-sm-3" id="1"> <div id="name1"></div> </div> <div class="col-sm-3" id="2"> <div id="name2"></div> </div> <div class="col-sm-3" id="3"> <div id="name3"></div> </div> <div class="col-sm-3" id="4"> <div id="name4"></div> ...