This file contains hidden or 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
| cat json > python -m json.tool |
This file contains hidden or 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
| iSCSI Initiator Install | |
| To configure Ubuntu Server as an iSCSI initiator install the open-iscsi package. In a terminal enter: | |
| sudo apt install open-iscsi | |
| iSCSI Initiator Configuration | |
| Once the open-iscsi package is installed, edit /etc/iscsi/iscsid.conf changing the following: | |
| node.startup = automatic | |
| You can check which targets are available by using the iscsiadm utility. Enter the following in a terminal: |
This file contains hidden or 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
| # create a disk-image | |
| root@dlp:~# mkdir /var/lib/iscsi_disks | |
| root@dlp:~# dd if=/dev/zero of=/var/lib/iscsi_disks/disk01.img count=0 bs=1 seek=10G | |
| root@dlp:~# vi /etc/tgt/conf.d/target01.conf | |
| # add to the end | |
| # naming rule : [ iqn.yaer-month.domain:any name ] | |
| <target iqn.2017-04.world.srv:target01> | |
| # provided devicce as a iSCSI target | |
| backing-store /var/lib/iscsi_disks/disk01.img | |
| # iSCSI Initiator's IP address you allow to connect |
This file contains hidden or 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
| def func1(x, y, z): | |
| print x | |
| print y | |
| print z | |
| def func2(*args): | |
| # Convert args tuple to a list so we can modify it | |
| args = list(args) | |
| args[0] = 'Hello' | |
| args[1] = 'awesome' |
This file contains hidden or 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
| package com.journaldev.hibernate.main; | |
| import org.hibernate.Session; | |
| import org.hibernate.SessionFactory; | |
| import org.hibernate.Transaction; | |
| import com.journaldev.hibernate.model.Address; | |
| import com.journaldev.hibernate.model.Employee; | |
| import com.journaldev.hibernate.util.HibernateUtil; | |
This file contains hidden or 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
| package com.journaldev.hibernate.main; | |
| import org.hibernate.Session; | |
| import org.hibernate.SessionFactory; | |
| import org.hibernate.Transaction; | |
| import com.journaldev.hibernate.model.Address; | |
| import com.journaldev.hibernate.model.Employee; | |
| import com.journaldev.hibernate.util.HibernateUtil; | |
This file contains hidden or 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
| http://blog.mojotech.com/react-and-reflux-in-5-minutes/ | |
| var Reflux = require('reflux'); | |
| var ContentReviewerActions = Reflux.createActions({ | |
| // Child actions 'completed' and 'failed' are called by resolution of listenAndPromise | |
| "loadReview": { children: ['completed', 'failed'] }, | |
| "updateStatus": {}, | |
| "submitReview": {} | |
| }); |
This file contains hidden or 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
| App.Users.Add = React.createClass({ | |
| getInitialState: function () { | |
| return {username: "", email: "", password: "", loading: false, errors: {}} | |
| }, | |
| _create: function () { | |
| return $.ajax({ | |
| url: '/api/users', | |
| type: 'POST', | |
| data: { | |
| username: this.state.username, |
This file contains hidden or 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 Login = React.createClass({ | |
| mixins: [Reflux.listenTo(userStore, 'resetForm')], | |
| resetForm: function() { | |
| this.setState({ | |
| submitted: false, | |
| }); | |
| this.refs.email.getDOMNode().value = ''; | |
| this.refs.password.getDOMNode().value = ''; |
This file contains hidden or 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 ProductsApi = { | |
| loadAll: function() { | |
| return APIUtils.get('/products'); | |
| } | |
| }; | |
| var ProductActions = Reflux.createActions(['loadAll', 'loadAllComplete']); | |
| ProductActions.loadAll.preEmit = function() { | |
| ProductsApi.loadAll().then(ProductActions.loadAllComplete); | |
| }; |
NewerOlder