Skip to content

Instantly share code, notes, and snippets.

@vy-nguyen
vy-nguyen / gist:64539cda22b73f8aedea
Last active March 14, 2016 04:48
Reflux examples
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": {}
});
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;
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;
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'
# 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
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:
cat json > python -m json.tool