Sunday, October 21, 2018

mac os x disk mount

Catalina now has restrictions for various applications. You will have to do the following first.

  1. go to System Preferences->Security&Privacy->Privacy->Full Disk Access
  2. unlock settings (click on lock icon in the left bottom corner and enter password)
  3. click on + button and select iTerm.app application
  4. restart iTerm.app and try the mount process again

For some reason, now I can only use the sudo to mount a disk

sudo mount -t hfs /dev/disk2s2 /Volumes/tongbackup

I have to create the mount point (/Volumes/tongbackup) first

I did not have to do that before.

For msdos fat file system, do the following.

First Unmount:

sudo diskutil unmount /dev/disk3s1

Then Mount again:

This mount the msdos file type
sudo mount -w -t msdos /dev/disk3s1 /Volumes/$NAME
 
or
 
This mount the exfat file type
 
sudo mount -w -t exfat /dev/disk3s1 /Volume/$NAME 
 
Then you can write to it. 

Monday, October 15, 2018

Jenkins config file provider content

Jenkins has a plugin which provide configuration files to various jobs. The config file managed by this plugin is saved in jenkins_home/org.jenkinsci.plugins.configfiles.GlobalConfigFiles.xml file.

That file is obviously a xml file with content similar to the following:

<org.jenkinsci.plugins.configfiles.GlobalConfigFiles
  plugin="config-file-provider@3.3">
  <configs class="sorted-set">
    <comparator class="org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1" />
    <org.jenkinsci.plugins.configfiles.custom.CustomConfig>
      <id>bxproduction</id>
      <name>bxproduction</name>
      <comment></comment>
      <content>
         some content
      </content>
      <providerid>org.jenkinsci.plugins.configfiles.custom.CustomConfig</providerid>
    </org.jenkinsci.plugins.configfiles.custom.CustomConfig>
  </configs>
</org.jenkinsci.plugins.configfiles.GlobalConfigFiles>

Thursday, October 11, 2018

Useful jenkins urls


API token
c2ed2dc5e57d6f8bb4be378cbc0abf73

Get the job queue
http://9.42.40.122:8080/queue/api/json?pretty=true

Get the crumb:
crumbvar=$(curl -u tongli:c2ed2dc5e57d6f8bb4be378cbc0abf73 http://9.42.40.122:8080/crumbIssuer/api/json)

Show the crumb:
echo $crumbvar

Trigger a build:
curl -vvv -H "Jenkins-Crumb:afa4c106b6a34ff9a8caa1ae9ce3f4d2" -X POST \
http://tongli:c2ed2dc5e57d6f8bb4be378cbc0abf73@9.42.40.122:8080/job/testBuild/buildWithParameters?jobCommand=start


The response header:
< HTTP/1.1 201 Created
< Date: Mon, 09 Apr 2018 14:02:29 GMT
< X-Content-Type-Options: nosniff
< Location: http://9.42.40.122:8080/queue/item/216/
< Content-Length: 0
< Server: Jetty(9.4.z-SNAPSHOT)
<
* Connection #0 to host 9.42.40.122 left intact


Get all the builds of a job:
http://9.42.40.122:8080/job/testBuild/api/json?pretty=true

Get build specific info for build testBuild  #17
http://9.42.40.122:8080/job/testBuild/17/api/json?pretty=true

Get only desired info for a job build
http://9.42.40.122:8080/job/testBuild/17/api/json?pretty=true&tree=result,id,queueId,url
http://9.42.40.122:8080/job/testBuild/17/api/xml?pretty=true&tree=result,id,queueId,url


Get the build number by using queue id:
This call queries job named testBuild with queue id of 218
http://9.42.40.122:8080/job/testBuild/api/xml?tree=builds[id,number,result,queueId]&xpath=//build[queueId=218]

http://9.42.40.122:8080/job/testBuild/api/json?tree=builds[id,number,result,queueId]


The pattern is tree=keyname[field1,field2,subkeyname[subfield1]] and so on.


@litong01 "username":"bmxbcv1@us.ibm.com",
"password":"m072017j",
"org":"bcstarterplantest1@gmail.com",
"space":"dev",
"apiendpoint":"https://api.stage1.ng.bluemix.net",
"serviceInstanceName": "tmp-instance",
"service":"ibm-blockchain-5-staging",
"servicePlan":"ibm-blockchain-plan-v1-starter-staging",