Deploy a new local war file
curl --anyauth --form deployWar=@war_file_path --user username:password http://tomcat_server_addr:8080/manager/html/upload
Undeploy
curl http://tomcat_server_addr:8080/manager/undeploy?path=/Context_Path --anyauth --user username:password
Reload
curl http://tomcat_server_addr:8080/manager/reload?path=/Context_Path --anyauth --user username:password
Archive for the ‘Yazılım’ Category
httping
httping is a small command line tool for ping http servers. Here an example
$ httping google.com Pinging :http://google.com 9324 bytes from http://google.com: seq=1 rep=[200/OK] time=11201 ms 9356 bytes from http://google.com: seq=2 rep=[200/OK] time=834 ms 9342 bytes from http://google.com: seq=3 rep=[200/OK] time=822 ms 9342 bytes from http://google.com: seq=4 rep=[200/OK] time=827 ms Avg :3421 ms - 9341 bytes Speed :2KB/second Health :%100
Download httping
Edit /etc/security/limits.conf add these lines
username soft nofile 4096
username hard nofile 8192
remember change “username” with your username.
relogin and enjoy.
import sys
pre = ‘out.println("‘ # satirbasi sql.append(" gibi
pst = ‘")‘ # satirsonu ") gibi
addslash = 1 # tirnaklara backslash
if len(sys.argv) == 1:
print "kullanim: \n \t\t python wrapper.py giris.txt \n \t\t > cikis.txt gerekiyorsa"
sys.exit(1)
f = open(sys.argv[1] ,’r‘)
for r in f:
if (addslash == 1):
r = r.replace(‘"‘,’\\"‘)
r = r.rstrip()
line = "%s%s%s" % (pre , r, pst)
print line
1 faktoriyel 0 = 1
2 faktoriyel a = a * faktoriyel (a - 1)
3 main = do putStrLn "Hangi Sayının faktöriyeli hesaplanacak ? "
4 say <- readLn
5 print (faktoriyel say)
6
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
/**
*
* @author Muhammed YÜRÜRDURMAZ
*/
@Entity
@Table(name = "KISI_TBL")
public class Kisi implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "KISI_ID")
private int KisiId;
@Column(name="ISIM", length=64, nullable=false)
private String isim;
@ManyToMany
@JoinTable(name = "KISI_TELEFON_TBL", joinColumns = {
@JoinColumn(name = "KISI_ID")},
inverseJoinColumns = {
@JoinColumn(name = "TELEFON_ID")})
private List<Telefon> telefonlar;
/**
* @return the KisiId
*/
public int getKisiId() {
return KisiId;
}
/**
* @param KisiId the KisiId to set
*/
public void setKisiId(int KisiId) {
this.KisiId = KisiId;
}
/**
* @return the isim
*/
public String getIsim() {
return isim;
}
/**
* @param isim the isim to set
*/
public void setIsim(String isim) {
this.isim = isim;
}
/**
* @return the telefonlar
*/
public List<Telefon> getTelefonlar() {
return telefonlar;
}
/**
* @param telefonlar the telefonlar to set
*/
public void setTelefonlar(List<Telefon> telefonlar) {
this.telefonlar = telefonlar;
}
}
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
/**
*
* @author Muhammed YÜRÜRDURMAZ
*/
@Entity
@Table(name = "TELEFON_TBL")
public class Telefon implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "TELEFO_ID")
private int telefonId;
@Column(name = "TELEFON_NO", length = 13, nullable = false)
private String telefonNo;
@ManyToMany(mappedBy="telefonlar")
private List<Kisi> kisiler;
/**
* @return the telefonId
*/
public int getTelefonId() {
return telefonId;
}
/**
* @param telefonId the telefonId to set
*/
public void setTelefonId(int telefonId) {
this.telefonId = telefonId;
}
/**
* @return the telefonNo
*/
public String getTelefonNo() {
return telefonNo;
}
/**
* @param telefonNo the telefonNo to set
*/
public void setTelefonNo(String telefonNo) {
this.telefonNo = telefonNo;
}
/**
* @return the kisiler
*/
public List<Kisi> getKisiler() {
return kisiler;
}
/**
* @param kisiler the kisiler to set
*/
public void setKisiler(List<Kisi> kisiler) {
this.kisiler = kisiler;
}
}
public static void main(String args[]) {
PropertyConfigurator.configure("c:\\dizin\\log4j.properties");
log = Logger.getLogger("class adı");
log.info("deneme");
}
Tags: log4j, log4j.properties
import java.io.Serializable;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
@Entity(name="resim")
public class Resim implements Serializable {
@Column(name="id")
@Id
private int id;
@Column(name="resim")
@Lob
private Blob resim;
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(int id) {
this.id = id;
}
/**
* @return the resim
*/
public Blob getResim() {
return resim;
}
/**
* @param resim the resim to set
*/
public void setResim(Blob resim) {
this.resim = resim;
}
}
Kullanım örneği
Resim r = new Resim(); r.setResim(Hibernate.createBlob(new FileInputStream("resim.jpg"))); s.save(r);Tags: Örnek, blob, Hibernate, Java
jboss heap size ayarı
jboss heap size ayarı bin/run.conf dosyasındaki
JAVA_OPTS=
ile başlayan satırdan yapılabilir.
Örnek min. 256m max. 1024m
JAVA_OPTS=”-Xms256m -Xmx1024m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000″
değişikliklerden sonra jboss u kapatıp açmayı unutmayın
windows üzerinde bin/run.conf.bat içerisinden yapılıyor
Tags: heap size, Java, JAVA_OPTS, jboss