ls /usr/share/zoneinfo
ls /usr/share/zoneinfo/Asia
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
or
tzselect
5)Asia
23)Korea(South)
vi /home/musesoft/.profile
TZ='Asia/Seoul'; export TZ
vi /root/.profile
TZ='Asia/Seoul'; export TZ
date
2015년 12월 30일 수요일
ntp setting with ubuntu
apt-get install ntp
## option
vi /etc/ntp.conf
pool.ntp.org # add
service ntp restart
## option
vi /etc/ntp.conf
pool.ntp.org # add
service ntp restart
2015년 12월 17일 목요일
2015년 12월 13일 일요일
odac 설치 후, 한글 깨짐 문제
odac : ODTwithODAC112030
추가 : 아무것도 변한게 없는데, 갑자기 oramts.dll 을 로드 하지 못한다고, 에러를 뿌려서, 기존 oracle client 가 설치 되어 있는 상태에서 odac 을 추가 설치 함. 오라클 홈은 d:\oracle 이고, odac 추가 설치 시 홈 디레토리는 d:\oracle 로 설정 하면 D:\oracle\product\11.2.0\client_2 이렇게 구성 됨, 문제는 기존 client 를 찾는 문제가 생기기 때문에 시스템 환경 변수에서 기존 D:\oracle\product\11.2.0\client_1\bin 을 제거 한다. 이후 한글 깨짐 현상이 나오는데, 아래와 같이 레지스트리를 추가 한다
regedit
HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > ORACLE > KEY_OraCleint11gHome2
add
NLS_LANG = KOREAN_KOREA.KO16MSWIN949
restart computer
추가 : 아무것도 변한게 없는데, 갑자기 oramts.dll 을 로드 하지 못한다고, 에러를 뿌려서, 기존 oracle client 가 설치 되어 있는 상태에서 odac 을 추가 설치 함. 오라클 홈은 d:\oracle 이고, odac 추가 설치 시 홈 디레토리는 d:\oracle 로 설정 하면 D:\oracle\product\11.2.0\client_2 이렇게 구성 됨, 문제는 기존 client 를 찾는 문제가 생기기 때문에 시스템 환경 변수에서 기존 D:\oracle\product\11.2.0\client_1\bin 을 제거 한다. 이후 한글 깨짐 현상이 나오는데, 아래와 같이 레지스트리를 추가 한다
regedit
HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > ORACLE > KEY_OraCleint11gHome2
add
NLS_LANG = KOREAN_KOREA.KO16MSWIN949
restart computer
2015년 12월 11일 금요일
vmware : This host is VT -capable, but VT is disabled with X220
bios option change
restart the computer and press BIOS Setting ( F12 or F10 ... )
Security - Virtulization Technology to enable
restart the computer and reimport
how to use log4cplus with Visual Studio 2012
download
http://sourceforge.net/projects/log4cplus/
\log4cplus-1.2.0-rc3\msvc10
build with Visual Studo 2012
log4cplus_configure.ini
###################################
########Define log Levels##########
###################################
#All classes - except those in log4cplus.logger.* - use DEBUG level to print information on file
log4cplus.rootLogger=DEBUG, MyFileAppender
#For MemoryCheck class I need to inspect all the details, and I want print information even to the console
log4cplus.logger.MemoryCheck=TRACE, MyConsoleAppender
#For database stuff, I don't need to logging everything, it's enough printing only errors!
log4cplus.logger.DatabaseOperations=ERROR
###################################
########Define the Appenders#######
###################################
#MyConsoleAppender:
log4cplus.appender.MyConsoleAppender=log4cplus::ConsoleAppender
log4cplus.appender.MyConsoleAppender.layout=log4cplus::PatternLayout
log4cplus.appender.MyConsoleAppender.layout.ConversionPattern=[%-5p][%d] %m%n
#MyFileAppender
log4cplus.appender.MyFileAppender=log4cplus::RollingFileAppender
log4cplus.appender.MyFileAppender.File=logging.txt
log4cplus.appender.MyFileAppender.MaxFileSize=16MB
log4cplus.appender.MyFileAppender.MaxBackupIndex=1
log4cplus.appender.MyFileAppender.layout=log4cplus::PatternLayout
log4cplus.appender.MyFileAppender.layout.ConversionPattern=[%-5p][%D{%Y/%m/%d %H:%M:%S:%q}][%-l][%t] %m%n
stdafx.h
#include <log4cplus/logger.h>
#include <log4cplus/loggingmacros.h>
#include <log4cplus/configurator.h>
#include <iomanip>
using namespace log4cplus;
extern Logger g_logger;
stdafx.cpp
#include "stdafx.h"
Logger g_logger;
AppDemoDlg.cpp
BOOL CAppDemoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
initialize();
PropertyConfigurator::doConfigure("log4cplus_configure.ini");
g_logger = Logger::getInstance(LOG4CPLUS_TEXT("main"));
g_logger.setLogLevel(TRACE_LOG_LEVEL);
LOG4CPLUS_INFO(g_logger, "OnInitDialog");
return TRUE;
}
http://sourceforge.net/projects/log4cplus/
\log4cplus-1.2.0-rc3\msvc10
build with Visual Studo 2012
log4cplus_configure.ini
###################################
########Define log Levels##########
###################################
#All classes - except those in log4cplus.logger.* - use DEBUG level to print information on file
log4cplus.rootLogger=DEBUG, MyFileAppender
#For MemoryCheck class I need to inspect all the details, and I want print information even to the console
log4cplus.logger.MemoryCheck=TRACE, MyConsoleAppender
#For database stuff, I don't need to logging everything, it's enough printing only errors!
log4cplus.logger.DatabaseOperations=ERROR
###################################
########Define the Appenders#######
###################################
#MyConsoleAppender:
log4cplus.appender.MyConsoleAppender=log4cplus::ConsoleAppender
log4cplus.appender.MyConsoleAppender.layout=log4cplus::PatternLayout
log4cplus.appender.MyConsoleAppender.layout.ConversionPattern=[%-5p][%d] %m%n
#MyFileAppender
log4cplus.appender.MyFileAppender=log4cplus::RollingFileAppender
log4cplus.appender.MyFileAppender.File=logging.txt
log4cplus.appender.MyFileAppender.MaxFileSize=16MB
log4cplus.appender.MyFileAppender.MaxBackupIndex=1
log4cplus.appender.MyFileAppender.layout=log4cplus::PatternLayout
log4cplus.appender.MyFileAppender.layout.ConversionPattern=[%-5p][%D{%Y/%m/%d %H:%M:%S:%q}][%-l][%t] %m%n
stdafx.h
#include <log4cplus/logger.h>
#include <log4cplus/loggingmacros.h>
#include <log4cplus/configurator.h>
#include <iomanip>
using namespace log4cplus;
extern Logger g_logger;
stdafx.cpp
#include "stdafx.h"
Logger g_logger;
AppDemoDlg.cpp
BOOL CAppDemoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
initialize();
PropertyConfigurator::doConfigure("log4cplus_configure.ini");
g_logger = Logger::getInstance(LOG4CPLUS_TEXT("main"));
g_logger.setLogLevel(TRACE_LOG_LEVEL);
LOG4CPLUS_INFO(g_logger, "OnInitDialog");
return TRUE;
}
2015년 12월 8일 화요일
samba client install & conf with ubuntu
os(smb client) : ubuntu 12.04
os(smb server) : centos 6.5
apt-get install smbclient cifs-utils
smbclient -L smbserverip -U%
mount -t cifs //smbserverip/museshare /mnt/sharefolder -o user=user,password=password,workgroup=workgroup,ip=smbserverip,iocharset=utf8
vi /etc/fstab
//smbserverip/museshare /mnt/sharefolder -o user=user,password=password,workgroup=workgroup,ip=smbserverip,iocharset=utf8
os(smb server) : centos 6.5
apt-get install smbclient cifs-utils
smbclient -L smbserverip -U%
mount -t cifs //smbserverip/museshare /mnt/sharefolder -o user=user,password=password,workgroup=workgroup,ip=smbserverip,iocharset=utf8
vi /etc/fstab
//smbserverip/museshare /mnt/sharefolder -o user=user,password=password,workgroup=workgroup,ip=smbserverip,iocharset=utf8
2015년 12월 7일 월요일
2015년 11월 30일 월요일
2015년 11월 27일 금요일
application pools setting with iis8
reference : https://www.iis.net/configreference/system.applicationhost/applicationpools/add
managedRuntimeVersion
v1.1 Specifies that the application pool use the CLR version 1.1.
v2.0 Specifies that the application pool use the CLR version 2.0, which can be .NET Framework version 2.0, 3.0, or 3.5.
v4.0 Specifies that the application pool use the CLR version 4.0, which can be .NET Framework version 4.0 or 4.5.
managedRuntimeVersion
v1.1 Specifies that the application pool use the CLR version 1.1.
v2.0 Specifies that the application pool use the CLR version 2.0, which can be .NET Framework version 2.0, 3.0, or 3.5.
v4.0 Specifies that the application pool use the CLR version 4.0, which can be .NET Framework version 4.0 or 4.5.
2015년 11월 25일 수요일
not build with android.mk
LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := ffmpeg LOCAL_SRC_FILES := libffmpeg.so include $(PREBUILT_SHARED_LIBRARY)
2015년 11월 24일 화요일
use echo print with android.mk
$(warning [warning] this the warning msg)
$(info [info] $(LOCAL_PATH))
2015년 11월 19일 목요일
unicode file write
Big-endian : 0xFEFF ( unicode )
Little-endian : 0xFFFE
if (pGSFile == NULL) {
pGSFile = _wfopen(L"ch_gsensor.dat", L"wb");
WORD mark = 0xFEFF;
fwrite(&mark, sizeof(WORD), 1, pGSFile);
}
Little-endian : 0xFFFE
if (pGSFile == NULL) {
pGSFile = _wfopen(L"ch_gsensor.dat", L"wb");
WORD mark = 0xFEFF;
fwrite(&mark, sizeof(WORD), 1, pGSFile);
}
2015년 11월 18일 수요일
manifest setting with visual studio 2012
c#
project > new item add > app.manifest
edit app.manifest
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 매니페스트 옵션
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
c++
project > properties > linker > manifest file
UAC Execution Level => "requireAdministrator (/level='requireAdministrator')"
project > new item add > app.manifest
edit app.manifest
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 매니페스트 옵션
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
c++
project > properties > linker > manifest file
UAC Execution Level => "requireAdministrator (/level='requireAdministrator')"
2015년 11월 12일 목요일
iis6 to iis8 migration
C:\Program Files\IIS\Microsoft Web Deploy V3
http://www.iis.net/learn/publish/using-web-deploy/packaging-and-restoring-a-web-site
http://www.iis.net/learn/publish/using-web-deploy/packaging-and-restoring-a-web-site
2015년 11월 11일 수요일
cygwin & eclipse
## for c / c++
cygwin (32bit)
server : http://ftp.daum.net
cygwin install ( devel full ) : D:\cygwin
envirenment add
CYGWIN_HOM = D:\cygwin
Path = ";%CYGWIN_HOME%\bin;%CYGWIN_HOME%\usr\include;"
eclipse
eclipse c/c++ plugin install ( https://eclipse.org/cdt/downloads.php )
Name : CDT
Location : http://download.eclipse.org/tools/cdt/releases/8.8.1
## for android
ndk
install ( D:\android\android-ndk-r10e )
bash file edit
D:\cygwin\home\Administrator\.bashrc
export ANDROID_NDK_ROOT=/cygdrive/d/android/android-ndk-r10e
cygwin (32bit)
server : http://ftp.daum.net
cygwin install ( devel full ) : D:\cygwin
envirenment add
CYGWIN_HOM = D:\cygwin
Path = ";%CYGWIN_HOME%\bin;%CYGWIN_HOME%\usr\include;"
eclipse
eclipse c/c++ plugin install ( https://eclipse.org/cdt/downloads.php )
Name : CDT
Location : http://download.eclipse.org/tools/cdt/releases/8.8.1
## for android
ndk
install ( D:\android\android-ndk-r10e )
bash file edit
D:\cygwin\home\Administrator\.bashrc
export ANDROID_NDK_ROOT=/cygdrive/d/android/android-ndk-r10e
2015년 11월 10일 화요일
checkbox select all with asp.net
javascript
<script type="text/javascript">
var TotalChkBx = 0;
var Counter = 0;
function gridOnLoad(rowCnt) {
TotalChkBx = rowCnt;
Counter = 0;
}
function HeaderClick(CheckBox) {
var TargetBaseControl = document.getElementById('<%= this.egvWPPrint.ClientID %>');
var TargetChildControl = "chkBxSelect";
try {
var Inputs = TargetBaseControl.getElementsByTagName("input");
for (var n = 0; n < Inputs.length; ++n)
if (Inputs[n].type == 'checkbox' && Inputs[n].id.indexOf(TargetChildControl, 0) >= 0)
Inputs[n].checked = CheckBox.checked;
Counter = CheckBox.checked ? TotalChkBx : 0;
}
catch (err) {
Counter = 0;
}
}
function ChildClick(CheckBox, HCheckBox) {
try {
var HeaderCheckBox = document.getElementById(HCheckBox);
if (CheckBox.checked && Counter < TotalChkBx)
Counter++;
else if (Counter > 0)
Counter--;
if (Counter < TotalChkBx)
HeaderCheckBox.checked = false;
else if (Counter == TotalChkBx)
HeaderCheckBox.checked = true;
}
catch (err) {
}
}
</script>
c#
// bind after
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "GridLoad", "gridOnLoad(" + ds.Tables[0].Rows.Count.ToString() + ");", true);
protected void egvWPPrint_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox chkBxSelect = (CheckBox)e.Row.Cells[1].FindControl("chkBxSelect");
CheckBox chkBxHeader = (CheckBox)this.egvWPPrint.HeaderRow.FindControl("chkBxHeader");
chkBxSelect.Attributes["onclick"] = string.Format
(
"javascript:ChildClick(this,'{0}');",
chkBxHeader.ClientID
);
}
}
aspx
<asp:TemplateField HeaderText="선택">
<ItemTemplate><asp:CheckBox ID="chkBxSelect" runat="server" /></ItemTemplate>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
<HeaderTemplate>
<asp:CheckBox ID="chkBxHeader" onclick="javascript:HeaderClick(this);" runat="server" />
</HeaderTemplate>
</asp:TemplateField>
<script type="text/javascript">
var TotalChkBx = 0;
var Counter = 0;
function gridOnLoad(rowCnt) {
TotalChkBx = rowCnt;
Counter = 0;
}
function HeaderClick(CheckBox) {
var TargetBaseControl = document.getElementById('<%= this.egvWPPrint.ClientID %>');
var TargetChildControl = "chkBxSelect";
try {
var Inputs = TargetBaseControl.getElementsByTagName("input");
for (var n = 0; n < Inputs.length; ++n)
if (Inputs[n].type == 'checkbox' && Inputs[n].id.indexOf(TargetChildControl, 0) >= 0)
Inputs[n].checked = CheckBox.checked;
Counter = CheckBox.checked ? TotalChkBx : 0;
}
catch (err) {
Counter = 0;
}
}
function ChildClick(CheckBox, HCheckBox) {
try {
var HeaderCheckBox = document.getElementById(HCheckBox);
if (CheckBox.checked && Counter < TotalChkBx)
Counter++;
else if (Counter > 0)
Counter--;
if (Counter < TotalChkBx)
HeaderCheckBox.checked = false;
else if (Counter == TotalChkBx)
HeaderCheckBox.checked = true;
}
catch (err) {
}
}
</script>
c#
// bind after
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "GridLoad", "gridOnLoad(" + ds.Tables[0].Rows.Count.ToString() + ");", true);
protected void egvWPPrint_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox chkBxSelect = (CheckBox)e.Row.Cells[1].FindControl("chkBxSelect");
CheckBox chkBxHeader = (CheckBox)this.egvWPPrint.HeaderRow.FindControl("chkBxHeader");
chkBxSelect.Attributes["onclick"] = string.Format
(
"javascript:ChildClick(this,'{0}');",
chkBxHeader.ClientID
);
}
}
aspx
<asp:TemplateField HeaderText="선택">
<ItemTemplate><asp:CheckBox ID="chkBxSelect" runat="server" /></ItemTemplate>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
<HeaderTemplate>
<asp:CheckBox ID="chkBxHeader" onclick="javascript:HeaderClick(this);" runat="server" />
</HeaderTemplate>
</asp:TemplateField>
2015년 11월 9일 월요일
2015년 11월 5일 목요일
asp.net control refresh by c#
asp.net
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
c#
Button1.text = "123";
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
c#
Button1.text = "123";
excel connection string info
Microsoft Access Database Engine 2010 Redistributable
https://www.connectionstrings.com/ace-oledb-12-0/
https://www.connectionstrings.com/ace-oledb-12-0/
2015년 11월 3일 화요일
mssql dbcc repair
step
Exec sp_resetstatus 'DBNAME'
Alter Database DBNAME SET EMERGENCY
DBCC checkdb ('DBNAME')
Alter Databases DBNAME Set Single_User with
Rollback Immediate
DBCC CheckDB('DBNAME', Repair_Allow_Data_Loss)
Alter Database DBNAME Set Multi_User
MSSQL Restart
** reference
running status with mssql 2005 above
select session_id, start_time, status,
command, percent_complete,
estimated_completion_time
from sys.dm_exec_requests
where session_id=53
single user error
SELECT request_session_id
FROM sys.dm_tran_locks
WHERE resource_database_id = DB_ID('DBNAME')
KILL 51
Exec sp_resetstatus 'DBNAME'
Alter Database DBNAME SET EMERGENCY
DBCC checkdb ('DBNAME')
Alter Databases DBNAME Set Single_User with
Rollback Immediate
DBCC CheckDB('DBNAME', Repair_Allow_Data_Loss)
Alter Database DBNAME Set Multi_User
MSSQL Restart
** reference
running status with mssql 2005 above
select session_id, start_time, status,
command, percent_complete,
estimated_completion_time
from sys.dm_exec_requests
where session_id=53
single user error
SELECT request_session_id
FROM sys.dm_tran_locks
WHERE resource_database_id = DB_ID('DBNAME')
KILL 51
oracle function ( number increment )
CREATE OR REPLACE FUNCTION TS.F_Seq RETURN VARCHAR2 IS
tmpSEQ NUMBER;
rtnSEQ VARCHAR2(12);
BEGIN
tmpSEQ := 0;
rtnSEQ := '';
SELECT NVL(TO_NUMBER(SUBSTR(MAX(SEQNO),12)),0) INTO tmpSEQ FROM TB__MASTER
WHERE SEQNO LIKE TO_CHAR(SYSDATE,'YYYYMMDD') || '%';
SELECT TO_CHAR(SYSDATE, 'YYYYMMDD') || '-' || LPAD(TO_CHAR(tmpSEQ+1),3,'0') INTO rtnSEQ FROM DUAL;
RETURN rtnSEQ;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN TO_CHAR(SYSDATE, 'YYYYMMDD') || '-001';
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END F_Seq;
/
tmpSEQ NUMBER;
rtnSEQ VARCHAR2(12);
BEGIN
tmpSEQ := 0;
rtnSEQ := '';
SELECT NVL(TO_NUMBER(SUBSTR(MAX(SEQNO),12)),0) INTO tmpSEQ FROM TB__MASTER
WHERE SEQNO LIKE TO_CHAR(SYSDATE,'YYYYMMDD') || '%';
SELECT TO_CHAR(SYSDATE, 'YYYYMMDD') || '-' || LPAD(TO_CHAR(tmpSEQ+1),3,'0') INTO rtnSEQ FROM DUAL;
RETURN rtnSEQ;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN TO_CHAR(SYSDATE, 'YYYYMMDD') || '-001';
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END F_Seq;
/
2015년 11월 2일 월요일
*** commands commence before first target. Stop
*** 첫번째 타겟보다 앞에서 명령어가 시작되었습니다. 멈춤.
==> space check of line end
==> space check of line end
2015년 10월 30일 금요일
radiobutton control by javascript with asp.net
RadioButtonResetAll(sMRNO);
function RadioButtonResetAll(rbDefaultValue) {
var RBID = '<%=rbMRNO.ClientID %>';
var RB1 = document.getElementById(RBID);
var radio = RB1.getElementsByTagName("input");
for (var i = 0; i < radio.length; i++) {
if (radio[i].value == rbDefaultValue) {
radio[i].checked = true;
}
}
<asp:RadioButtonList ID="rbMRNO" runat="server" Width="174px" RepeatDirection="Horizontal" >
<asp:ListItem Value="true">yes</asp:ListItem>
<asp:ListItem Selected="True" Value="false">no</asp:ListItem>
</asp:RadioButtonList>
function RadioButtonResetAll(rbDefaultValue) {
var RBID = '<%=rbMRNO.ClientID %>';
var RB1 = document.getElementById(RBID);
var radio = RB1.getElementsByTagName("input");
for (var i = 0; i < radio.length; i++) {
if (radio[i].value == rbDefaultValue) {
radio[i].checked = true;
}
}
<asp:RadioButtonList ID="rbMRNO" runat="server" Width="174px" RepeatDirection="Horizontal" >
<asp:ListItem Value="true">yes</asp:ListItem>
<asp:ListItem Selected="True" Value="false">no</asp:ListItem>
</asp:RadioButtonList>
column hide for BoundField
.hiddencol
{
display:none;
}
<asp:BoundField DataField="AUART" SortExpression="AUART" HeaderText="order" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol">
{
display:none;
}
<asp:BoundField DataField="AUART" SortExpression="AUART" HeaderText="order" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol">
2015년 10월 29일 목요일
RegisterPostBackControl add & file download for dynamic LinkButton
asp.net
<asp:TemplateField HeaderText="name">
<ItemTemplate><asp:LinkButton ID="lbFildDW" CommandArgument='<%# Bind("DOCBIGO") %>' runat="server" Text='<%# Bind("DOCNAME") %>' OnClick="ExcelDW_Click"></asp:LinkButton> </ItemTemplate>
<itemstyle horizontalalign="Center" Wrap="false"/> <headerstyle Wrap="false"/>
</asp:TemplateField>
c#
protected void egvPopDDSearch_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkbtnDetail = (LinkButton)e.Row.FindControl("lbFildDW");
ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkbtnDetail);
}
}
protected void ExcelDW_Click(object sender, EventArgs e)
{
LinkButton btn = (LinkButton)(sender);
string filePath = btn.CommandArgument;
if (File.Exists(HttpContext.Current.Server.MapPath(filePath)))
{
string strFileName = "";
strFileName = System.IO.Path.GetFileName(HttpContext.Current.Server.MapPath(filePath));
strFileName = HttpUtility.UrlEncode(strFileName, new UTF8Encoding()).Replace("+", "%20");
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.WriteFile(HttpContext.Current.Server.MapPath(filePath));
HttpContext.Current.Response.End();
}
}
<asp:TemplateField HeaderText="name">
<ItemTemplate><asp:LinkButton ID="lbFildDW" CommandArgument='<%# Bind("DOCBIGO") %>' runat="server" Text='<%# Bind("DOCNAME") %>' OnClick="ExcelDW_Click"></asp:LinkButton> </ItemTemplate>
<itemstyle horizontalalign="Center" Wrap="false"/> <headerstyle Wrap="false"/>
</asp:TemplateField>
c#
protected void egvPopDDSearch_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkbtnDetail = (LinkButton)e.Row.FindControl("lbFildDW");
ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkbtnDetail);
}
}
protected void ExcelDW_Click(object sender, EventArgs e)
{
LinkButton btn = (LinkButton)(sender);
string filePath = btn.CommandArgument;
if (File.Exists(HttpContext.Current.Server.MapPath(filePath)))
{
string strFileName = "";
strFileName = System.IO.Path.GetFileName(HttpContext.Current.Server.MapPath(filePath));
strFileName = HttpUtility.UrlEncode(strFileName, new UTF8Encoding()).Replace("+", "%20");
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.WriteFile(HttpContext.Current.Server.MapPath(filePath));
HttpContext.Current.Response.End();
}
}
2015년 10월 28일 수요일
row number add with group by result
SELECT ROW_NUMBER() OVER (ORDER BY NAME DESC) SEQ, NAME FROM TABLE GROUP BY NAME
2015년 10월 26일 월요일
debug for javascript
for crome ( 45.17.2454.18 )
tool : visual studio 2012
function getReturnValue(returnValue) {
debugger; // this
var obj = JSON.parse(returnValue);
var oAUFNR = $('<%= txtAUFNR.ClientID %>');
oAUFNR.value = obj.AUFNR;
}
crome -> tools... -> developer tools
tool : visual studio 2012
function getReturnValue(returnValue) {
debugger; // this
var obj = JSON.parse(returnValue);
var oAUFNR = $('<%= txtAUFNR.ClientID %>');
oAUFNR.value = obj.AUFNR;
}
crome -> tools... -> developer tools
Call Server side method from JavaScript in ASP.NET
http://www.morgantechspace.com/2014/01/Call-Server-Side-function-from-JavaScript-in-ASP-NET.html#ByJQueryajaxWithParameters
javascript for json
https://github.com/douglascrockford/JSON-js
<script type="text/javascript" src="../Resources/Scripts/json2.js"></script>
<script type="text/javascript">
function getReturnValue(returnValue) {
var obj = JSON.parse(returnValue);
var oAUFNR = $('<%= txtAUFNR.ClientID %>');
oAUFNR.value = obj.AUFNR;
}
</script>
<script type="text/javascript" src="../Resources/Scripts/json2.js"></script>
<script type="text/javascript">
function getReturnValue(returnValue) {
var obj = JSON.parse(returnValue);
var oAUFNR = $('<%= txtAUFNR.ClientID %>');
oAUFNR.value = obj.AUFNR;
}
</script>
2015년 10월 15일 목요일
SAP Connector with ASP.NET
requirement
NCo3016_Net20_x86.msi
add reference ( C:\Program Files (x86)\SAP\SAP_DotNetConnector3_Net20_x86 )
sapnco.dll, sapnco_utils.dll
source code for c# with asp.net
DataSet ds = new DataSet("T_DATA");
try
{
RfcDestination rfcDestination = null;
IDestinationConfiguration destinationConfig = null;
string destinationName = "SAP.LogonControl.1";
destinationConfig = new SAPDestinationConfig();
destinationConfig.GetParameters(destinationName);
if (RfcDestinationManager.TryGetDestination(destinationName) == null)
{
RfcDestinationManager.RegisterDestinationConfiguration(destinationConfig);
rfcDestination = RfcDestinationManager.GetDestination(destinationName);
if (rfcDestination != null)
{
rfcDestination.Ping();
}
RfcRepository rfcRepository = rfcDestination.Repository;
IRfcFunction rfcFunction = rfcRepository.CreateFunction("Z_XXXXX_ORDER");
rfcFunction.SetValue("I_AXXXX", sWO);
rfcFunction.Invoke(rfcDestination);
ds.Tables.Add(ConvertToDotNetTable(rfcFunction.GetTable("T_DATA")));
RfcDestinationManager.UnregisterDestinationConfiguration(destinationConfig);
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
return ds;
NCo3016_Net20_x86.msi
add reference ( C:\Program Files (x86)\SAP\SAP_DotNetConnector3_Net20_x86 )
sapnco.dll, sapnco_utils.dll
source code for c# with asp.net
DataSet ds = new DataSet("T_DATA");
try
{
RfcDestination rfcDestination = null;
IDestinationConfiguration destinationConfig = null;
string destinationName = "SAP.LogonControl.1";
destinationConfig = new SAPDestinationConfig();
destinationConfig.GetParameters(destinationName);
if (RfcDestinationManager.TryGetDestination(destinationName) == null)
{
RfcDestinationManager.RegisterDestinationConfiguration(destinationConfig);
rfcDestination = RfcDestinationManager.GetDestination(destinationName);
if (rfcDestination != null)
{
rfcDestination.Ping();
}
RfcRepository rfcRepository = rfcDestination.Repository;
IRfcFunction rfcFunction = rfcRepository.CreateFunction("Z_XXXXX_ORDER");
rfcFunction.SetValue("I_AXXXX", sWO);
rfcFunction.Invoke(rfcDestination);
ds.Tables.Add(ConvertToDotNetTable(rfcFunction.GetTable("T_DATA")));
RfcDestinationManager.UnregisterDestinationConfiguration(destinationConfig);
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
return ds;
2015년 10월 13일 화요일
dual nic setup for centos
## WAN
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=118.x.x.x
NETMASK=255.0.0.0
GATEWAY=118.x.x.x
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
HWADDR=x:x:x:x:x
NM_CONTROLLED=no
USERCTL=no
## NAT
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.x
NETMASK=255.255.255.0
#GATEWAY=192.168.0.1 # this point
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=no # this point
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
HWADDR=x:x:x:x:x
NM_CONTROLLED="no"
USERCTL=no
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=118.x.x.x
NETMASK=255.0.0.0
GATEWAY=118.x.x.x
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
HWADDR=x:x:x:x:x
NM_CONTROLLED=no
USERCTL=no
## NAT
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.x
NETMASK=255.255.255.0
#GATEWAY=192.168.0.1 # this point
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=no # this point
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
HWADDR=x:x:x:x:x
NM_CONTROLLED="no"
USERCTL=no
2015년 10월 12일 월요일
sdf file disable
tool >> option >> txt editor >> c/c++ >> advanced >> Always Use Fallback Location >> True
abbreviation
ADAS, Advanced Driver Assistance System
ADPCM, Adaptive Differential Pulse Code Modulation
IMU, Inertial Measurement Unit
FPGA, Field Programmable Gate Arrays
BSP, Board Support Package
EDID, Extended display identification data
HDMI, High Definition Multimedia Interface
DVFS, Dynamic Voltage Frequency Scaling
HDMI, High Definition Multimedia Interface
DVFS, Dynamic Voltage Frequency Scaling
2015년 10월 11일 일요일
mp4 save with ffmpeg
ip cam -> raw data(encoded) -> mp4 save
AVCodec *ce;
AVFormatContext *fc;
AVOutputFormat *of;
AVCodecContext *pcc;
AVStream *pst;
int vi;
AVPacket pkt;
BOOL CCodec_Encoder_h264::FileInit(char *fname, int nWidth, int nHeight)
{
av_register_all();
avcodec_register_all();
of = av_guess_format(0, fname, 0);
fc = avformat_alloc_context();
fc->oformat = of;
strcpy(fc->filename, fname);
pst = avformat_new_stream(fc, 0);
vi = pst->index;
ce = avcodec_find_decoder(CODEC_ID_H264);
pcc = pst->codec;
avcodec_get_context_defaults3(pcc, ce);
pcc->codec_type = AVMEDIA_TYPE_VIDEO;
pcc->codec_id = CODEC_ID_H264;
pcc->profile= FF_PROFILE_H264_BASELINE;
pcc->bit_rate = 1280 * 960 * 2;
pcc->width = nWidth;
pcc->height = nHeight;
pcc->time_base.num = 1;
pcc->time_base.den = 30;
pcc->qcompress = 0.6;
pcc->qmin = 0;
pcc->qmax = 9;
pcc->pix_fmt = PIX_FMT_YUV420P;
pcc->gop_size = 150;
if ( !( fc->oformat->flags & AVFMT_NOFILE ) )
avio_open( &fc->pb, fc->filename, AVIO_FLAG_WRITE );
avformat_write_header(fc, NULL);
m_nFrmCnt = 0;
waitkey = 1;
return TRUE;
}
BOOL CCodec_Encoder_h264::FileAppend(BYTE *pData, int nSize, , DWORD key)
{
AVPacket pkt;
av_init_packet(&pkt);
//pkt.flags |= (0 >= getVopType(pData, nSize )) ? AV_PKT_FLAG_KEY : 0;
pkt.flags |= key;
//pkt.stream_index = m_nFrmCnt++;
pkt.data = (uint8_t*)pData;
pkt.size = nSize;
if ( waitkey )
if ( 0 == ( pkt.flags & AV_PKT_FLAG_KEY ) )
return TRUE;
else
waitkey = 0;
av_write_frame(fc, &pkt);
return TRUE;
}
BOOL CCodec_Encoder_h264::FileClose()
{
av_write_trailer(fc);
if ( fc->oformat && !( fc->oformat->flags & AVFMT_NOFILE ) && fc->pb )
avio_close( fc->pb );
av_free(fc);
return TRUE;
}
AVCodec *ce;
AVFormatContext *fc;
AVOutputFormat *of;
AVCodecContext *pcc;
AVStream *pst;
int vi;
AVPacket pkt;
BOOL CCodec_Encoder_h264::FileInit(char *fname, int nWidth, int nHeight)
{
av_register_all();
avcodec_register_all();
of = av_guess_format(0, fname, 0);
fc = avformat_alloc_context();
fc->oformat = of;
strcpy(fc->filename, fname);
pst = avformat_new_stream(fc, 0);
vi = pst->index;
ce = avcodec_find_decoder(CODEC_ID_H264);
pcc = pst->codec;
avcodec_get_context_defaults3(pcc, ce);
pcc->codec_type = AVMEDIA_TYPE_VIDEO;
pcc->codec_id = CODEC_ID_H264;
pcc->profile= FF_PROFILE_H264_BASELINE;
pcc->bit_rate = 1280 * 960 * 2;
pcc->width = nWidth;
pcc->height = nHeight;
pcc->time_base.num = 1;
pcc->time_base.den = 30;
pcc->qcompress = 0.6;
pcc->qmin = 0;
pcc->qmax = 9;
pcc->pix_fmt = PIX_FMT_YUV420P;
pcc->gop_size = 150;
if ( !( fc->oformat->flags & AVFMT_NOFILE ) )
avio_open( &fc->pb, fc->filename, AVIO_FLAG_WRITE );
avformat_write_header(fc, NULL);
m_nFrmCnt = 0;
waitkey = 1;
return TRUE;
}
BOOL CCodec_Encoder_h264::FileAppend(BYTE *pData, int nSize, , DWORD key)
{
AVPacket pkt;
av_init_packet(&pkt);
//pkt.flags |= (0 >= getVopType(pData, nSize )) ? AV_PKT_FLAG_KEY : 0;
pkt.flags |= key;
//pkt.stream_index = m_nFrmCnt++;
pkt.data = (uint8_t*)pData;
pkt.size = nSize;
if ( waitkey )
if ( 0 == ( pkt.flags & AV_PKT_FLAG_KEY ) )
return TRUE;
else
waitkey = 0;
av_write_frame(fc, &pkt);
return TRUE;
}
BOOL CCodec_Encoder_h264::FileClose()
{
av_write_trailer(fc);
if ( fc->oformat && !( fc->oformat->flags & AVFMT_NOFILE ) && fc->pb )
avio_close( fc->pb );
av_free(fc);
return TRUE;
}
c# Struct Marshal for c++ dll
c++
typedef struct
{
HANDLE aaa;
HWND bbb;
BYTE ccc[2500];
} SStruct, LPSCStruct;
BOOL __stdcall func1(LPSCStruct zzz);
c#
public struct LPSCStruct
{
public int aaa;
public IntPtr bbb;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2500)]
public byte[] ccc;
}
public partial class Form1 : Form /*, IMessageFilter*/
{
[DllImport("test.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.I1)]
unsafe extern public static bool func1(IntPtr zzz);
public LPSCStruct sss;
public LPSCStruct rrr;
public IntPtr m_lpstruct;
private void Form1_Load(object sender, EventArgs e)
{
sss = new LPSCStruct();
}
private IntPtr MarshalToPointer(object data)
{
IntPtr buf = Marshal.AllocHGlobal(Marshal.SizeOf(pse));
Marshal.StructureToPtr(data, buf, false);
return buf;
}
private object MarshalToStruct(IntPtr buf, Type t)
{
return Marshal.PtrToStructure(buf, t);
}
private void button1_Click(object sender, EventArgs e)
{
sss.bbb = FindWindow(null, "Form1");
m_lpstruct = MarshalToPointer(sss);
bool bRtn = func1(m_lpstruct);
if (bRtn)
{
rrr = (LPSCStruct)MarshalToStruct(m_lpstruct, typeof(LPSCStruct));
textBox1.AppendText(Encoding.Default.GetString(rrr.ccc));
}
}
typedef struct
{
HANDLE aaa;
HWND bbb;
BYTE ccc[2500];
} SStruct, LPSCStruct;
BOOL __stdcall func1(LPSCStruct zzz);
c#
public struct LPSCStruct
{
public int aaa;
public IntPtr bbb;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2500)]
public byte[] ccc;
}
public partial class Form1 : Form /*, IMessageFilter*/
{
[DllImport("test.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.I1)]
unsafe extern public static bool func1(IntPtr zzz);
public LPSCStruct sss;
public LPSCStruct rrr;
public IntPtr m_lpstruct;
private void Form1_Load(object sender, EventArgs e)
{
sss = new LPSCStruct();
}
private IntPtr MarshalToPointer(object data)
{
IntPtr buf = Marshal.AllocHGlobal(Marshal.SizeOf(pse));
Marshal.StructureToPtr(data, buf, false);
return buf;
}
private object MarshalToStruct(IntPtr buf, Type t)
{
return Marshal.PtrToStructure(buf, t);
}
private void button1_Click(object sender, EventArgs e)
{
sss.bbb = FindWindow(null, "Form1");
m_lpstruct = MarshalToPointer(sss);
bool bRtn = func1(m_lpstruct);
if (bRtn)
{
rrr = (LPSCStruct)MarshalToStruct(m_lpstruct, typeof(LPSCStruct));
textBox1.AppendText(Encoding.Default.GetString(rrr.ccc));
}
}
2015년 10월 3일 토요일
2015년 10월 1일 목요일
redirect with post data
public void RedirectWithData(NameValueCollection data, string url)
{
Response.Clear();
Response.Buffer = true;
StringBuilder s = new StringBuilder();
s.Append("<html>");
s.Append("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head>");
s.AppendFormat("<body onload='document.forms[0].submit()'>");
s.AppendFormat("<form name='form' action='{0}' method='POST'>", url);
foreach (string key in data)
{
s.AppendFormat("<input type='hidden' name='{0}' value='{1}' />", key, data[key].Trim());
}
s.Append("</form></body></html>");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("euc-kr");
Response.Write(s.ToString());
Response.Flush();
Response.End();
}
NameValueCollection tags = new NameValueCollection();
tags.Add("param1", "value1");
tags.Add("param2", "value2");
tags.Add("param3", "value3");
RedirectWithData(tags, "../test/test.aspx");
{
Response.Clear();
Response.Buffer = true;
StringBuilder s = new StringBuilder();
s.Append("<html>");
s.Append("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head>");
s.AppendFormat("<body onload='document.forms[0].submit()'>");
s.AppendFormat("<form name='form' action='{0}' method='POST'>", url);
foreach (string key in data)
{
s.AppendFormat("<input type='hidden' name='{0}' value='{1}' />", key, data[key].Trim());
}
s.Append("</form></body></html>");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("euc-kr");
Response.Write(s.ToString());
Response.Flush();
Response.End();
}
NameValueCollection tags = new NameValueCollection();
tags.Add("param1", "value1");
tags.Add("param2", "value2");
tags.Add("param3", "value3");
RedirectWithData(tags, "../test/test.aspx");
2015년 9월 23일 수요일
web.config 의 복호화
windows prompt
cd C:\windows\Microsoft.NET\Framework\v2.0.50727
aspnet_regiis -pdf "connectionStrings" D:\temp
or
aspnet_regiis -pdf "system.web/machineKey" D:\temp
web.config 를 다른 곳에서 사용하기 위해서 원본 web.config 가 있는 곳에서 먼저 복호화를 해야 한다
cd C:\windows\Microsoft.NET\Framework\v2.0.50727
aspnet_regiis -pdf "connectionStrings" D:\temp
or
aspnet_regiis -pdf "system.web/machineKey" D:\temp
web.config 를 다른 곳에서 사용하기 위해서 원본 web.config 가 있는 곳에서 먼저 복호화를 해야 한다
2015년 9월 21일 월요일
using the windows headers
https://msdn.microsoft.com/ko-kr/library/aa383745.aspx
Minimum system required Minimum value for _WIN32_WINNT and WINVER
Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602)
Windows 8 _WIN32_WINNT_WIN8 (0x0602)
Windows 7 _WIN32_WINNT_WIN7 (0x0601)
Windows Server 2008 _WIN32_WINNT_WS08 (0x0600)
Windows Vista _WIN32_WINNT_VISTA (0x0600)
Windows Server 2003 with SP1, Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502)
Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501)
Minimum system required Minimum value for _WIN32_WINNT and WINVER
Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602)
Windows 8 _WIN32_WINNT_WIN8 (0x0602)
Windows 7 _WIN32_WINNT_WIN7 (0x0601)
Windows Server 2008 _WIN32_WINNT_WS08 (0x0600)
Windows Vista _WIN32_WINNT_VISTA (0x0600)
Windows Server 2003 with SP1, Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502)
Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501)
2015년 9월 17일 목요일
2015년 9월 15일 화요일
samba install & conf with ubuntu
## linux
useradd username
passwd username
apt-get install samba
smbpasswd -a username
vim /etc/samba/smb.conf
[sharename]
comment = Samba Server
path = /home/username
valid users = username
writable = yes
public = yes
create mask = 0777
directory mask = 0777
service samba restart
service smbd restart
## windows
\\192.168.0.x
login
useradd username
passwd username
apt-get install samba
smbpasswd -a username
vim /etc/samba/smb.conf
[sharename]
comment = Samba Server
path = /home/username
valid users = username
writable = yes
public = yes
create mask = 0777
directory mask = 0777
service smbd restart
## windows
\\192.168.0.x
login
2015년 9월 11일 금요일
Error found when loading /root/.profile
Error found when loading /root/.profile
stdin: is not a tty
as a result the session will not be configured correctly
==>
vi /root/.profile
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
tty -s && mesg n
#mesg n
stdin: is not a tty
as a result the session will not be configured correctly
==>
vi /root/.profile
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
tty -s && mesg n
#mesg n
2015년 9월 10일 목요일
7z with ubuntu
apt-get install p7zip
unzip : 7zr x filename.7z
zip : 7zr a filename.7z filename1 test2 test3
unzip : 7zr x filename.7z
zip : 7zr a filename.7z filename1 test2 test3
2015년 9월 6일 일요일
proxy bypass
utils
http://www.ultrasurf.us/
crome plugin
Data Compression Proxy for Google Chrome on Desktop
http://www.ultrasurf.us/
crome plugin
Data Compression Proxy for Google Chrome on Desktop
2015년 9월 2일 수요일
dns info
인터넷 서비스 업체 SK 브로드밴드 올레 KT LG 유플러스
기본 DNS 서버 219.250.36.130 168.126.63.1 164.124.107.9
보조 DNS 서버 210.220.163.82 168.126.63.2 203.248.242.2
기본 DNS 서버 219.250.36.130 168.126.63.1 164.124.107.9
보조 DNS 서버 210.220.163.82 168.126.63.2 203.248.242.2
2015년 9월 1일 화요일
video rendering with c++
buffer is PIX_FMT_BGR24 data
m_flipview is dc for rendering
uchar buf[sizeof(BITMAPINFO) + 256 * 4];
BITMAPINFO* bmi = (BITMAPINFO*)buf;
BITMAPINFOHEADER* bmih = &(bmi->bmiHeader);
memset(bmih, 0, sizeof(*bmih));
bmih->biSize = sizeof(BITMAPINFOHEADER);
bmih->biWidth = m_pCodec[DevID]->m_nWidth;
bmih->biHeight = -m_pCodec[DevID]->m_nHeight;
bmih->biPlanes = 1;
bmih->biBitCount = 24;
bmih->biCompression = BI_RGB;
HDC hdc = m_pDlg->m_flipview.GetDC()->m_hDC;
::SetStretchBltMode(hdc, COLORONCOLOR);
::StretchDIBits(hdc, 0, 0, 640, 360,
0, 0, m_pCodec[DevID]->m_nWidth, m_pCodec[DevID]->m_nHeight,
buffer, bmi,
DIB_RGB_COLORS, SRCCOPY);
m_flipview is dc for rendering
uchar buf[sizeof(BITMAPINFO) + 256 * 4];
BITMAPINFO* bmi = (BITMAPINFO*)buf;
BITMAPINFOHEADER* bmih = &(bmi->bmiHeader);
memset(bmih, 0, sizeof(*bmih));
bmih->biSize = sizeof(BITMAPINFOHEADER);
bmih->biWidth = m_pCodec[DevID]->m_nWidth;
bmih->biHeight = -m_pCodec[DevID]->m_nHeight;
bmih->biPlanes = 1;
bmih->biBitCount = 24;
bmih->biCompression = BI_RGB;
HDC hdc = m_pDlg->m_flipview.GetDC()->m_hDC;
::SetStretchBltMode(hdc, COLORONCOLOR);
::StretchDIBits(hdc, 0, 0, 640, 360,
0, 0, m_pCodec[DevID]->m_nWidth, m_pCodec[DevID]->m_nHeight,
buffer, bmi,
DIB_RGB_COLORS, SRCCOPY);
snmp with centos
yum install net-snmp net-snmp-utils
vi /etc/snmp/snmpd.conf
# Map 'idv90we3rnov90wer' community to the 'ConfigUser'
# Map '209ijvfwer0df92jd' community to the 'AllUser'
# sec.name source community
com2sec ConfigUser default idv90we3rnov90wer
com2sec AllUser default 209ijvfwer0df92jd
# Map 'ConfigUser' to 'ConfigGroup' for SNMP Version 2c
# Map 'AllUser' to 'AllGroup' for SNMP Version 2c
# sec.model sec.name
group ConfigGroup v2c ConfigUser
group AllGroup v2c AllUser
# Define 'SystemView', which includes everything under .1.3.6.1.2.1.1 (or .1.3.6.1.2.1.25.1)
# Define 'AllView', which includes everything under .1
# incl/excl subtree
view SystemView included .1.3.6.1.2.1.1
view SystemView included .1.3.6.1.2.1.25.1.1
view AllView included .1
# Give 'ConfigGroup' read access to objects in the view 'SystemView'
# Give 'AllGroup' read access to objects in the view 'AllView'
# context model level prefix read write notify
access ConfigGroup "" any noauth exact SystemView none none
access AllGroup "" any noauth exact AllView none none
/etc/init.d/snmpd restart
vi /etc/snmp/snmpd.conf
# Map 'idv90we3rnov90wer' community to the 'ConfigUser'
# Map '209ijvfwer0df92jd' community to the 'AllUser'
# sec.name source community
com2sec ConfigUser default idv90we3rnov90wer
com2sec AllUser default 209ijvfwer0df92jd
# Map 'ConfigUser' to 'ConfigGroup' for SNMP Version 2c
# Map 'AllUser' to 'AllGroup' for SNMP Version 2c
# sec.model sec.name
group ConfigGroup v2c ConfigUser
group AllGroup v2c AllUser
# Define 'SystemView', which includes everything under .1.3.6.1.2.1.1 (or .1.3.6.1.2.1.25.1)
# Define 'AllView', which includes everything under .1
# incl/excl subtree
view SystemView included .1.3.6.1.2.1.1
view SystemView included .1.3.6.1.2.1.25.1.1
view AllView included .1
# Give 'ConfigGroup' read access to objects in the view 'SystemView'
# Give 'AllGroup' read access to objects in the view 'AllView'
# context model level prefix read write notify
access ConfigGroup "" any noauth exact SystemView none none
access AllGroup "" any noauth exact AllView none none
/etc/init.d/snmpd restart
splash activity with adnroid
SplashActivity.java
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashActivity extends Activity {
// Splash screen timer
private static int SPLASH_TIME_OUT = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
Intent i = new Intent(SplashActivity.this, MainActivity.class);
startActivity(i);
finish();
}
}, SPLASH_TIME_OUT);
}
}
AndroidManifest.xml
<!-- Splash screen -->
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.MAIN" />
</intent-filter>
</activity>
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashActivity extends Activity {
// Splash screen timer
private static int SPLASH_TIME_OUT = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
Intent i = new Intent(SplashActivity.this, MainActivity.class);
startActivity(i);
finish();
}
}, SPLASH_TIME_OUT);
}
}
AndroidManifest.xml
<!-- Splash screen -->
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.MAIN" />
</intent-filter>
</activity>
git for eclipse
help > install new software
1. http://download.eclipse.org/egit/updates
2. "Eclipse Git Team Provider" select
1. http://download.eclipse.org/egit/updates
2. "Eclipse Git Team Provider" select
2015년 8월 23일 일요일
원격 데스크톱 연결 허용
1. 방화벽 3389 허용 ( 제어판 > Windows 방화벽 > 고급 설정 > 인바운드 규칙 > 원격 데스크톱(Tcp-In)
2. 해당 계정에 암호가 없는 경우 설정
3. 이 컴퓨터에 대한 원격 지원 연결 허용, 모든 버전의 원격 데스크톱을 실행 중인 컴퓨터에서 연결허용 ( 컴퓨터 > 설정 > 원격설정 )
4. 윈도우 실행 시 암호 물어보기 ( 시작 > 실행 > netplwiz )
5. 리부팅
2. 해당 계정에 암호가 없는 경우 설정
3. 이 컴퓨터에 대한 원격 지원 연결 허용, 모든 버전의 원격 데스크톱을 실행 중인 컴퓨터에서 연결허용 ( 컴퓨터 > 설정 > 원격설정 )
4. 윈도우 실행 시 암호 물어보기 ( 시작 > 실행 > netplwiz )
5. 리부팅
2015년 8월 21일 금요일
appcompat_v7 errors
Set Project Build Path as Android 5.0 (API level 21)
Set the project target as : target=android-21
Set the project target as : target=android-21
No compatible targets where found
No compatible targets where found. Do you wish to add new Android Virtual
install by Android SDK Manager
"Google USB Driver"
if samsung phone, install driver
http://local.sec.samsung.com/comLocal/support/down/kies_main.do?kind=usb
install by Android SDK Manager
"Google USB Driver"
if samsung phone, install driver
http://local.sec.samsung.com/comLocal/support/down/kies_main.do?kind=usb
2015년 8월 20일 목요일
samba server install & conf with centos
yum install samba
chkconfig smb on
mkdir /home/sharename
useradd sharename
passwd sharename
smbpasswd -a sharename ( exist user )
chmod 777 /home/sharename
/etc/samba/smb.conf ( add )
[sharename]
comment = sharename
path = /home/sharename
public = yes
writable = yes
write list = sharename KK
cresate mask = 0777
directory mask = 0777
iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart
/etc/init.d/smb restart
chkconfig smb on
mkdir /home/sharename
useradd sharename
passwd sharename
smbpasswd -a sharename ( exist user )
chmod 777 /home/sharename
/etc/samba/smb.conf ( add )
[sharename]
comment = sharename
path = /home/sharename
public = yes
writable = yes
write list = sharename KK
cresate mask = 0777
directory mask = 0777
iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart
/etc/init.d/smb restart
2015년 8월 17일 월요일
wireless static set for centos by wpa_supplicant
centos : Linux localhost.localdomain 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
1. wpa_passphrase ssidname pskpassword
2. vi /etc/sysconfig/wpa_supplicant
# Use the flag "-i" before each of your interfaces, like so:
# INTERFACES="-ieth1 -iwlan0"
INTERFACES="-iwlan0"
# Use the flag "-D" before each driver, like so:
# DRIVERS="-Dwext"
DRIVERS=""
# Other arguments
# -u Enable the D-Bus interface (required for use with NetworkManager)
# -f Log to /var/log/wpa_supplicant.log
# -P Write pid file to /var/run/wpa_supplicant.pid
# required to return proper codes by init scripts (e.g. double "start" action)
# -B to daemonize that has to be used together with -P is already in wpa_supplicant.init.d
OTHER_ARGS="-u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid"
3. vi /etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE=wlan0
TYPE=Wireless
ONBOOT=yes
NM_CONTROLLED=no
HWADDR=30:10:B3:04:7C:1B
BOOTPROTO=static
BROADCAST=xxx.xxx.xxx.xxx
IPADDR=xxx.xxx.xxx.xxx
PREFIX=24
GATEWAY=192.168.0.1
DNS1=xxx.xxx.xxx.xxx
IPV6INIT=no
NETWORKING_IPV6=no
ESSID="ssidname"
4. /etc/init.d/network restart
1. wpa_passphrase ssidname pskpassword
2. vi /etc/sysconfig/wpa_supplicant
# Use the flag "-i" before each of your interfaces, like so:
# INTERFACES="-ieth1 -iwlan0"
INTERFACES="-iwlan0"
# Use the flag "-D" before each driver, like so:
# DRIVERS="-Dwext"
DRIVERS=""
# Other arguments
# -u Enable the D-Bus interface (required for use with NetworkManager)
# -f Log to /var/log/wpa_supplicant.log
# -P Write pid file to /var/run/wpa_supplicant.pid
# required to return proper codes by init scripts (e.g. double "start" action)
# -B to daemonize that has to be used together with -P is already in wpa_supplicant.init.d
OTHER_ARGS="-u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid"
3. vi /etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE=wlan0
TYPE=Wireless
ONBOOT=yes
NM_CONTROLLED=no
HWADDR=30:10:B3:04:7C:1B
BOOTPROTO=static
BROADCAST=xxx.xxx.xxx.xxx
IPADDR=xxx.xxx.xxx.xxx
PREFIX=24
GATEWAY=192.168.0.1
DNS1=xxx.xxx.xxx.xxx
IPV6INIT=no
NETWORKING_IPV6=no
ESSID="ssidname"
4. /etc/init.d/network restart
2015년 8월 10일 월요일
adt plugin install for eclipse
https://dl-ssl.google.com/android/eclipse/
http://developer.android.com/sdk/index.html ==> download
** JAVA_HOME Envirenment Setting
Android SDK install
http://developer.android.com/sdk/index.html ==> download
** JAVA_HOME Envirenment Setting
Android SDK install
2015년 8월 5일 수요일
git use for visual studio 2012
requirement
1. Visual Studio Update 4 ( http://www.microsoft.com/en-us/download/details.aspx?id=39305 )
2. TortoiseGit ( https://code.google.com/p/tortoisegit/ )
3. Git Source Control Provider ( https://gitscc.codeplex.com/ )
4. git for windows ( https://msysgit.github.io/ )
1. Visual Studio Update 4 ( http://www.microsoft.com/en-us/download/details.aspx?id=39305 )
2. TortoiseGit ( https://code.google.com/p/tortoisegit/ )
3. Git Source Control Provider ( https://gitscc.codeplex.com/ )
4. git for windows ( https://msysgit.github.io/ )
2015년 8월 3일 월요일
Windows SDK
Windows XP = SDK v5.0
Winodws 2003 = SDK v6.0
Vista / Windows 2008 = SDK v6.1
Windows 7 = SDK v7.0
Windows 7 and .NET Framework 4 = SDK v7.1
Winodws 2003 = SDK v6.0
Vista / Windows 2008 = SDK v6.1
Windows 7 = SDK v7.0
Windows 7 and .NET Framework 4 = SDK v7.1
2015년 7월 30일 목요일
HW info for linux
dmidecode -t typenumber
:: DMI table decoder
Type Information
--------------------------------------------
0 BIOS
1 System
2 Baseboard
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Devices Extended Information
42 Management Controller Host Interface
:: DMI table decoder
Type Information
--------------------------------------------
0 BIOS
1 System
2 Baseboard
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Devices Extended Information
42 Management Controller Host Interface
2015년 7월 21일 화요일
simple rtsp by ffmpeg
vi /etc/ffserver.conf
HTTPPort 7000
RTSPPort 7001
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
<Feed test.ffm>
File /tmp/test.ffm
FileMaxSize 1M
</Feed>
<Stream test.h264>
Feed test.ffm
Format rtp
VideoSize 640x480
VideoFrameRate 5
#VideoBitrate 800
#VideoBufferSize 40
#VideoCodec libx264
NoAudio
MulticastAddress 239.255.0.1
MulticastPort 20001
MulticastTTL 4
Metadata title "test"
</Stream>
<Stream test.rtsp>
Feed test.ffm
Format rtp
VideoSize 640x480
NoAudio
Metadata title "test"
</Stream>
<Stream stat.html>
Format status
ACL allow 192.168.0.0 192.168.0.255
</Stream>
## rtsp start
ffserver
## input
ffmpeg -re -i ./source.mp4 -vcodec copy -acodec copy http://rtspip:7000/test.ffm
## recv renderring
rtsp://rtspip:7001/test.rtsp
## status check
http://rtspip:7000/stat.html
## ffmpeg info
ffserver version git-2015-05-25-e48a9ac Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfreetype --enable-libx264
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 40.100 / 56. 40.100
libavformat 56. 33.101 / 56. 33.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
HTTPPort 7000
RTSPPort 7001
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
<Feed test.ffm>
File /tmp/test.ffm
FileMaxSize 1M
</Feed>
<Stream test.h264>
Feed test.ffm
Format rtp
VideoSize 640x480
VideoFrameRate 5
#VideoBitrate 800
#VideoBufferSize 40
#VideoCodec libx264
NoAudio
MulticastAddress 239.255.0.1
MulticastPort 20001
MulticastTTL 4
Metadata title "test"
</Stream>
<Stream test.rtsp>
Feed test.ffm
Format rtp
VideoSize 640x480
NoAudio
Metadata title "test"
</Stream>
<Stream stat.html>
Format status
ACL allow 192.168.0.0 192.168.0.255
</Stream>
## rtsp start
ffserver
## input
ffmpeg -re -i ./source.mp4 -vcodec copy -acodec copy http://rtspip:7000/test.ffm
## recv renderring
rtsp://rtspip:7001/test.rtsp
## status check
http://rtspip:7000/stat.html
## ffmpeg info
ffserver version git-2015-05-25-e48a9ac Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfreetype --enable-libx264
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 40.100 / 56. 40.100
libavformat 56. 33.101 / 56. 33.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
audio capture & udp send by cscore
public class AudioCapture
{
public enum CaptureMode
{
Capture,
LoopbackCapture
}
private const CaptureMode captureMode = CaptureMode.LoopbackCapture;
private MMDevice _selectedDevice;
private WasapiCapture _soundIn;
private IWaveSource _finalSource;
private bool bCapturedStop = false;
private const int AUDIOBLOCKSIZE = 3528;
public MMDevice SelectedDevice
{
get { return _selectedDevice; }
set
{
_selectedDevice = value;
}
}
private AudioSender audioSender = new AudioSender();
public bool AudioDeviceInit()
{
bool bRtn = false;
try
{
using (var deviceEnumerator = new MMDeviceEnumerator())
using (var deviceCollection = deviceEnumerator.EnumAudioEndpoints(
captureMode == CaptureMode.Capture ? DataFlow.Capture : DataFlow.Render, DeviceState.Active))
{
foreach (var device in deviceCollection)
{
var deviceFormat = WaveFormatFromBlob(device.PropertyStore[
new PropertyKey(new Guid(0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c), 0)].BlobValue);
_selectedDevice = device;
bRtn = true;
}
}
}
catch (Exception e)
{
K_BoxLog.LogDebug(e);
}
return bRtn;
}
public bool AudioCaptureStart(string serverip)
{
bool bRtn = false;
try
{
if (SelectedDevice == null)
{
return false;
}
if (AudioSender.connected == false)
audioSender.AudioSendConnect(serverip);
if (captureMode == CaptureMode.Capture)
_soundIn = new WasapiCapture();
else
_soundIn = new WasapiLoopbackCapture();
_soundIn.Device = SelectedDevice;
_soundIn.Initialize();
var soundInSource = new SoundInSource(_soundIn, AUDIOBLOCKSIZE * 4);
var singleBlockNotificationStream = new SimpleNotificationSource(soundInSource);
_finalSource = singleBlockNotificationStream
.ToWaveSource(16);
byte[] buffer = new byte[AUDIOBLOCKSIZE * 2];
soundInSource.DataAvailable += (s, e) =>
{
int read;
while ((read = _finalSource.Read(buffer, 0, buffer.Length)) > 0)
{
audioSender.AudioSend(buffer, read);
}
};
_soundIn.Start();
bRtn = true;
}
catch { }
return bRtn;
}
private void SingleBlockNotificationStreamOnSingleBlockRead(object sender, SingleBlockReadEventArgs e)
{
}
public bool AudioCaptureStop()
{
bool bRtn = false;
try
{
if (AudioSender.connected == true)
audioSender.AudioSendDisconnect();
_soundIn.Stop();
bRtn = false;
}
catch { }
return bRtn;
}
private static WaveFormat WaveFormatFromBlob(Blob blob)
{
if (blob.Length == 40)
return (WaveFormat)Marshal.PtrToStructure(blob.Data, typeof(WaveFormatExtensible));
return (WaveFormat)Marshal.PtrToStructure(blob.Data, typeof(WaveFormat));
}
}
{
public enum CaptureMode
{
Capture,
LoopbackCapture
}
private const CaptureMode captureMode = CaptureMode.LoopbackCapture;
private MMDevice _selectedDevice;
private WasapiCapture _soundIn;
private IWaveSource _finalSource;
private bool bCapturedStop = false;
private const int AUDIOBLOCKSIZE = 3528;
public MMDevice SelectedDevice
{
get { return _selectedDevice; }
set
{
_selectedDevice = value;
}
}
private AudioSender audioSender = new AudioSender();
public bool AudioDeviceInit()
{
bool bRtn = false;
try
{
using (var deviceEnumerator = new MMDeviceEnumerator())
using (var deviceCollection = deviceEnumerator.EnumAudioEndpoints(
captureMode == CaptureMode.Capture ? DataFlow.Capture : DataFlow.Render, DeviceState.Active))
{
foreach (var device in deviceCollection)
{
var deviceFormat = WaveFormatFromBlob(device.PropertyStore[
new PropertyKey(new Guid(0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c), 0)].BlobValue);
_selectedDevice = device;
bRtn = true;
}
}
}
catch (Exception e)
{
K_BoxLog.LogDebug(e);
}
return bRtn;
}
public bool AudioCaptureStart(string serverip)
{
bool bRtn = false;
try
{
if (SelectedDevice == null)
{
return false;
}
if (AudioSender.connected == false)
audioSender.AudioSendConnect(serverip);
if (captureMode == CaptureMode.Capture)
_soundIn = new WasapiCapture();
else
_soundIn = new WasapiLoopbackCapture();
_soundIn.Device = SelectedDevice;
_soundIn.Initialize();
var soundInSource = new SoundInSource(_soundIn, AUDIOBLOCKSIZE * 4);
var singleBlockNotificationStream = new SimpleNotificationSource(soundInSource);
_finalSource = singleBlockNotificationStream
.ToWaveSource(16);
byte[] buffer = new byte[AUDIOBLOCKSIZE * 2];
soundInSource.DataAvailable += (s, e) =>
{
int read;
while ((read = _finalSource.Read(buffer, 0, buffer.Length)) > 0)
{
audioSender.AudioSend(buffer, read);
}
};
_soundIn.Start();
bRtn = true;
}
catch { }
return bRtn;
}
private void SingleBlockNotificationStreamOnSingleBlockRead(object sender, SingleBlockReadEventArgs e)
{
}
public bool AudioCaptureStop()
{
bool bRtn = false;
try
{
if (AudioSender.connected == true)
audioSender.AudioSendDisconnect();
_soundIn.Stop();
bRtn = false;
}
catch { }
return bRtn;
}
private static WaveFormat WaveFormatFromBlob(Blob blob)
{
if (blob.Length == 40)
return (WaveFormat)Marshal.PtrToStructure(blob.Data, typeof(WaveFormatExtensible));
return (WaveFormat)Marshal.PtrToStructure(blob.Data, typeof(WaveFormat));
}
}
2015년 7월 20일 월요일
windows icons
Control Box 16x16x256
Taskbar 16x16x256
Notify Icon 32x32x256, shrunk down (see below)
Desktop Shortcut 32x32x256 (Normal sized icons)
48x48x256 (Large sized icons)
Add/Remove Programs 16x16x256
Folder Browse dialog 16x16x256
Taskbar 16x16x256
Notify Icon 32x32x256, shrunk down (see below)
Desktop Shortcut 32x32x256 (Normal sized icons)
48x48x256 (Large sized icons)
Add/Remove Programs 16x16x256
Folder Browse dialog 16x16x256
2015년 7월 16일 목요일
2015년 7월 14일 화요일
redmine install
ref : http://www.redmine.org/projects/redmine/wiki/install_Redmine_25x_on_Centos_65_complete
http://gen.jusz.pl/2014/04/19/how-to-install-redmine-2-5-on-centos-6-5/
keypoint :
rvm list
rvm list knwon
rvm install 2.1
rvm use 2.1.x --default
current redmine :
Environment:
Redmine version 2.5.0.stable
Ruby version 2.1.6-p336 (2015-04-13) [x86_64-linux]
Rails version 3.2.17
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.11
Mercurial 1.4
Git 1.7.1
Filesystem
Redmine plugins:
redmine_agile 1.3.9
http://gen.jusz.pl/2014/04/19/how-to-install-redmine-2-5-on-centos-6-5/
keypoint :
rvm list
rvm list knwon
rvm install 2.1
rvm use 2.1.x --default
current redmine :
Environment:
Redmine version 2.5.0.stable
Ruby version 2.1.6-p336 (2015-04-13) [x86_64-linux]
Rails version 3.2.17
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.11
Mercurial 1.4
Git 1.7.1
Filesystem
Redmine plugins:
redmine_agile 1.3.9
2015년 6월 29일 월요일
unable to resolve target 'android'
Unable to resolve target 'android-1' - (Android 1.0) change the "default.properties"
Unable to resolve target 'android-2' - (Android 1.1) change the "default.properties"
Unable to resolve target 'android-3' - install SDK Platform Android 1.5
Unable to resolve target 'android-4' - install SDK Platform Android 1.6
Unable to resolve target 'android-5' - install SDK Platform Android 2.0
Unable to resolve target 'android-6' - install SDK Platform Android 2.0.1
Unable to resolve target 'android-7' - install SDK Platform Android 2.1
Unable to resolve target 'android-8' - install SDK Platform Android 2.2
Unable to resolve target 'android-9' - install SDK Platform Android 2.3
Unable to resolve target 'android-10' - install SDK Platform Android 2.3.3
Unable to resolve target 'android-11' - install SDK Platform Android 3.0
Unable to resolve target 'android-12' - install SDK Platform Android 3.1
Unable to resolve target 'android-13' - install SDK Platform Android 3.2
Unable to resolve target 'android-14' - install SDK Platform Android 4.0
Unable to resolve target 'android-15' - install SDK Platform Android 4.0.3
Unable to resolve target 'android-16' - install SDK Platform Android 4.1
Unable to resolve target 'android-17' - install SDK Platform Android 4.2
Unable to resolve target 'android-18' - install SDK Platform Android 4.3
Unable to resolve target 'android-19' - install SDK Platform Android 4.4
Unable to resolve target 'android-20' - (Android 4.4w) change the "default.properties"
Unable to resolve target 'android-21' - install SDK Platform Android 5.0.1
Unable to resolve target 'android-2' - (Android 1.1) change the "default.properties"
Unable to resolve target 'android-3' - install SDK Platform Android 1.5
Unable to resolve target 'android-4' - install SDK Platform Android 1.6
Unable to resolve target 'android-5' - install SDK Platform Android 2.0
Unable to resolve target 'android-6' - install SDK Platform Android 2.0.1
Unable to resolve target 'android-7' - install SDK Platform Android 2.1
Unable to resolve target 'android-8' - install SDK Platform Android 2.2
Unable to resolve target 'android-9' - install SDK Platform Android 2.3
Unable to resolve target 'android-10' - install SDK Platform Android 2.3.3
Unable to resolve target 'android-11' - install SDK Platform Android 3.0
Unable to resolve target 'android-12' - install SDK Platform Android 3.1
Unable to resolve target 'android-13' - install SDK Platform Android 3.2
Unable to resolve target 'android-14' - install SDK Platform Android 4.0
Unable to resolve target 'android-15' - install SDK Platform Android 4.0.3
Unable to resolve target 'android-16' - install SDK Platform Android 4.1
Unable to resolve target 'android-17' - install SDK Platform Android 4.2
Unable to resolve target 'android-18' - install SDK Platform Android 4.3
Unable to resolve target 'android-19' - install SDK Platform Android 4.4
Unable to resolve target 'android-20' - (Android 4.4w) change the "default.properties"
Unable to resolve target 'android-21' - install SDK Platform Android 5.0.1
2015년 6월 26일 금요일
LNK2029 모듈이 SAFESEH 이미지에 대해 안전하지 않습니다
os : window7 64
tool : visual studio 2012
속성 - 구성 속성 - 링커 - 고급 - 이미지에 안전한 예외 처리기 포함 : 아니요 (/SAFESEH:NO)
tool : visual studio 2012
속성 - 구성 속성 - 링커 - 고급 - 이미지에 안전한 예외 처리기 포함 : 아니요 (/SAFESEH:NO)
2015년 6월 16일 화요일
delete dir or folder for windows console
- not need utility
- windows7 64 bit
- grant problem
rmdir /s "foldername"
2015년 5월 30일 토요일
ftpget
ftpget -u root -p passwd 192.168.0.123 mencoder /mencoder
user, password, host, filename, remote file path ( root direcotry )
user, password, host, filename, remote file path ( root direcotry )
2015년 5월 26일 화요일
ffmpeg
FFmpeg provides various tools:
- ffmpeg is a command line tool to convert multimedia files between formats.
- ffserver is a multimedia streaming server for live broadcasts.
- ffplay is a simple media player based on SDL and the FFmpeg libraries.
- ffprobe is a is a simple multimedia stream analyzer.
and developers libraries:
- libavutil is a library containing functions for simplifying programming, including random number generators, data structures, mathematics routines, core multimedia utilities, and much more.
- libavcodec is a library containing decoders and encoders for audio/video codecs.
- libavformat is a library containing demuxers and muxers for multimedia container formats.
- libavdevice is a library containing input and output devices for grabbing from and rendering to many common multimedia input/output software frameworks, including Video4Linux, Video4Linux2, VfW, and ALSA.
- libavfilter is a library containing media filters.
- libswscale is a library performing highly optimized image scaling and color space/pixel format conversion operations.
- libswresample is a library performing highly optimized audio resampling, rematrixing and sample format conversion operations.
2015년 5월 23일 토요일
install ffmpeg on centos
install with yum
vi /etc/yum.repos.d/dag.repo
[dag]
name=DAG RPM Repository
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
save
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
yum search ffmpeg
yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc
[root@localhost ~]# ffmpeg -version
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
FFmpeg 0.6.5
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
manual install
yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/yasm/yasm.git
cd yasm
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
make distclean
cd ~/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --disable-examples
make
make install
make clean
cd ~/ffmpeg_sources
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
make
make install
make distclean
cd ~/ffmpeg_sources
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfreetype --enable-libvpx --enable-libx264
make
make install
make distclean
hash -r
[root@localhost ffmpeg]# ffmpeg -version
ffmpeg version git-2015-05-25-e48a9ac Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfreetype --enable-libx264
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 40.100 / 56. 40.100
libavformat 56. 33.101 / 56. 33.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
vi /etc/yum.repos.d/dag.repo
[dag]
name=DAG RPM Repository
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
save
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
yum search ffmpeg
yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc
[root@localhost ~]# ffmpeg -version
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
FFmpeg 0.6.5
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
manual install
yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/yasm/yasm.git
cd yasm
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
make distclean
cd ~/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --disable-examples
make
make install
make clean
cd ~/ffmpeg_sources
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
make
make install
make distclean
cd ~/ffmpeg_sources
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfreetype --enable-libvpx --enable-libx264
make
make install
make distclean
hash -r
[root@localhost ffmpeg]# ffmpeg -version
ffmpeg version git-2015-05-25-e48a9ac Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfreetype --enable-libx264
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 40.100 / 56. 40.100
libavformat 56. 33.101 / 56. 33.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
2015년 5월 22일 금요일
App Config 이 잘못되었습니다
Visual Studio 에서 old version 의 프로젝트 migration 시 간혹 "App Config 이 잘못되었습니다" 메세지가 발생하는 경우
프로젝트 아래에 app.config 파일 만들고
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
작성하고, 프로젝트 다시 연단
프로젝트 아래에 app.config 파일 만들고
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
작성하고, 프로젝트 다시 연단
2015년 5월 16일 토요일
version of visual studio
브랜드 버전 내부 버전 #define _MSC_VER 버전
Visual C++ 2005 VC8 1400
Visual C++ 2008 VC9 1500
Visual C++ 2010 VC10 1600
Visual C++ 2012 VC11 1700
Visual C++ 2005 VC8 1400
Visual C++ 2008 VC9 1500
Visual C++ 2010 VC10 1600
Visual C++ 2012 VC11 1700
2015년 4월 30일 목요일
android:largeHeap
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:largeHeap="true"
여려가지 이유에서 android bitmap 처리를 하다보면, 대책없이 dalvic 에서 out of memory 가 나서 app 이 crash 되는 경우가 있다. AndroidManifest.xml 추가
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:largeHeap="true"
android:largeHeap
Whether your application's processes should be created with a large Dalvik heap. This applies to all processes created for the application. It only applies to the first application loaded into a process; if you're using a shared user ID to allow multiple applications to use a process, they all must use this option consistently or they will have unpredictable results.
Most apps should not need this and should instead focus on reducing their overall memory usage for improved performance. Enabling this also does not guarantee a fixed increase in available memory, because some devices are constrained by their total available memory.
To query the available memory size at runtime, use the methods
getMemoryClass()
orgetLargeMemoryClass()
.
ref : http://developer.android.com/guide/topics/manifest/application-element.html
2015년 4월 29일 수요일
directory size with linux
du -h --apparent-size /home
or
du -h -s --apparent-size /home
du -hs /home
or
du -h -s --apparent-size /home
du -hs /home
icon size for android app
Low Density Per Inch (ldpi) - 36 x 36 pixel
Medium Density Per Inch (mdpi) - 48 x 48 pixel
High Density Per Inch (hdpi) - 72 x 72 pixel
eXtra High Density Per Inch (xhdpi) - 96 x 96 pixel
eXtra eXtra High Density Per Inch (xxhdpi) - 144 x 144 pixel
Medium Density Per Inch (mdpi) - 48 x 48 pixel
High Density Per Inch (hdpi) - 72 x 72 pixel
eXtra High Density Per Inch (xhdpi) - 96 x 96 pixel
eXtra eXtra High Density Per Inch (xxhdpi) - 144 x 144 pixel
2015년 4월 6일 월요일
install android studio for ubuntu
# jdk
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
# android studio
sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio
reboot
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
# android studio
sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio
reboot
gnome with ubuntu 14
sudo apt-get install gnome-session-flashback
reboot
login - (GNOME Flashback (metacity)) select
reboot
login - (GNOME Flashback (metacity)) select
crontab
yum install crontabs ( for not found with centos )
crontab -l
crontab -e
0 0 * * * mysqldump -u root -ppassword redmine > /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_db_backup.sql
vi /etc/cron.allow ( add user for allow )
/etc/init.d/crond restart
sample >
0 0 * * * mysqldump -u root -pabwmthvmxm.co.kr redmine > /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_db_backup.sql
0 0 * * * tar -czvf /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_file_backup.tar.gz /var/lib/redmine/files
23 15 * * 0 tar -czvf /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_git_backup.tar.gz /home/git
0 0 * * * find /home/pointermans/backup/redmine/ -type f -name "*.*" -mtime +5 -exec rm {} \;
============
stop & disable
============
/etc/init.d/crond stop
mv /var/spool/cron /var/spool/cron_is_disabled
crontab -l
crontab -e
0 0 * * * mysqldump -u root -ppassword redmine > /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_db_backup.sql
vi /etc/cron.allow ( add user for allow )
/etc/init.d/crond restart
sample >
0 0 * * * mysqldump -u root -pabwmthvmxm.co.kr redmine > /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_db_backup.sql
0 0 * * * tar -czvf /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_file_backup.tar.gz /var/lib/redmine/files
23 15 * * 0 tar -czvf /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_git_backup.tar.gz /home/git
0 0 * * * find /home/pointermans/backup/redmine/ -type f -name "*.*" -mtime +5 -exec rm {} \;
============
stop & disable
============
/etc/init.d/crond stop
mv /var/spool/cron /var/spool/cron_is_disabled
2015년 4월 5일 일요일
search header file with ubuntu
apt-get install libx11-dev
apt-get install apt-file
apt-file update
apt-file search Xlib.h
apt-get install apt-file
apt-file update
apt-file search Xlib.h
X11 lib 사용해서 gcc 로 윈도우 띄우기
apt-get install libx11-dev
int main(int argc , char** argv)
{
Display *d ;
Window w, root ;
d = XOpenDisplay(NULL) ;
root = XDefaultRootWindow (d);
w = XCreateSimpleWindow ( d, root, 50, 50, 400, 300,
2, BlackPixel (d,0), WhitePixel(d,0) );
XMapWindow (d, w);
XFlush (d);
getchar();
XCloseDisplay (d);
return 0;
}
gcc -o test test.c -lX11
int main(int argc , char** argv)
{
Display *d ;
Window w, root ;
d = XOpenDisplay(NULL) ;
root = XDefaultRootWindow (d);
w = XCreateSimpleWindow ( d, root, 50, 50, 400, 300,
2, BlackPixel (d,0), WhitePixel(d,0) );
XMapWindow (d, w);
XFlush (d);
getchar();
XCloseDisplay (d);
return 0;
}
gcc -o test test.c -lX11
2015년 4월 4일 토요일
migration adt to android studio
1. adt 로 일단 빌드/실행까지 성공해야, android studio 에서 작업 할 수 있음, 안 그럼 app module 을 load 할 수 없음
2. 소스내에서 android ndk 가 필요한 경우, ndk 를 설치해도 다음과 같은 오류가 발생
Error:(283) *** Android NDK: Aborting . Stop.
Error:Execution failed for task ':app:compileDebugNdk'.
2. 소스내에서 android ndk 가 필요한 경우, ndk 를 설치해도 다음과 같은 오류가 발생
Error:(283) *** Android NDK: Aborting . Stop.
Error:Execution failed for task ':app:compileDebugNdk'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/pointermans/Documents/Work/android_ndk/android-ndk-r10d/ndk-build'' finished with non-zero exit value 2
3. build.gradle ( module ) 에 다음을 추가가 ( android 태그 안에 두어야 함 )
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir 'src/main/libs'
}
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir 'src/main/libs'
}
2015년 4월 1일 수요일
setting for asterisk cdr record ( mysql )
vi /etc/asterisk/cdr_mysql.conf
[global]
hostname=xxx.xxx.xxx.xxx
dbname=mysqldatabasename
table=cdr
password=mysqluserpassword
user=mysqluser
/etc/init.d/asterisk restart
[global]
hostname=xxx.xxx.xxx.xxx
dbname=mysqldatabasename
table=cdr
password=mysqluserpassword
user=mysqluser
/etc/init.d/asterisk restart
2015년 3월 17일 화요일
pair plantronics voyager edge for mac
1. plantronics edge power on
2. plantronics edge anwer button long push
3. bluetooth setting with mac
4. click pair button ( PLT_Edge ) with mac
2. plantronics edge anwer button long push
3. bluetooth setting with mac
4. click pair button ( PLT_Edge ) with mac
how to sdl install for ubuntu 14
sdl2-2.0.3
sudo apt-get install libsdl2-dev
sudo apt-get install mercurial
hg clone https://hg.libsdl.org/SDL SDL
cd SDL
mkdir build
cd build
../configure
make
sudo make install
sudo apt-get install libsdl2-dev
sudo apt-get install mercurial
hg clone https://hg.libsdl.org/SDL SDL
cd SDL
mkdir build
cd build
../configure
make
sudo make install
how to ffmpeg install for ubuntu 14
사실 인터넷에 많은 자료 들이 있지만, 자신의 환경과 일치하는 버전와 tip 을 사용해야 한다
본 문서 작성 당시, ubuntu14.04.1, ffmpeg-2.61, sdl2-2.0.3 을 사용하는데, ffmpeg, sdl2 은 수 많은 외부 라이브러리들이 사용되므로, 구조적으로 함수들이 재정의 되거나, 없어지거나, 새로 만들어지는 경우가 허다 하다
인터넷 자료들은 믿을만한 내용을 찾기가 쉽지 않다
배포사 사이트에서 guide 를 찾는 것이 가장 현명 하다
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
위의 url 을 참조하는 것이 좋으며, ffmpeg 빌드만 아래 내용을 참조한다. 아직 sdl2 와 호환 되지 않는 부분이 있어, makefile 만들기가 만만치 않다
cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-nonfree
PATH="$HOME/bin:$PATH" make
make install
make distclean
hash -r
이것 저것 넣었다가 빼보고 테스트 하느라, 누락 된 부분이 있을 수 있어, 추후 ubuntu 초기화 하고 다시 정리해야 한다 ( remind )
libsdl1.2-dev : 현재 ubuntu bug 로 설치가 되지 않는다 ( remind )
본 문서 작성 당시, ubuntu14.04.1, ffmpeg-2.61, sdl2-2.0.3 을 사용하는데, ffmpeg, sdl2 은 수 많은 외부 라이브러리들이 사용되므로, 구조적으로 함수들이 재정의 되거나, 없어지거나, 새로 만들어지는 경우가 허다 하다
인터넷 자료들은 믿을만한 내용을 찾기가 쉽지 않다
배포사 사이트에서 guide 를 찾는 것이 가장 현명 하다
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
위의 url 을 참조하는 것이 좋으며, ffmpeg 빌드만 아래 내용을 참조한다. 아직 sdl2 와 호환 되지 않는 부분이 있어, makefile 만들기가 만만치 않다
cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-nonfree
PATH="$HOME/bin:$PATH" make
make install
make distclean
hash -r
이것 저것 넣었다가 빼보고 테스트 하느라, 누락 된 부분이 있을 수 있어, 추후 ubuntu 초기화 하고 다시 정리해야 한다 ( remind )
libsdl1.2-dev : 현재 ubuntu bug 로 설치가 되지 않는다 ( remind )
2015년 3월 16일 월요일
how to git for ubunto console
apt-get install git
git config --global user.name "id"
git config --global user.email "email"
git config --list
git init
git add .
git commit -m “initial commit”
git remote add origin ssh://id@remoteip/git-repos/musesoft/recodia/avm-demo.git
git push origin master
git config --global user.name "id"
git config --global user.email "email"
git config --list
git init
git add .
git commit -m “initial commit”
git remote add origin ssh://id@remoteip/git-repos/musesoft/recodia/avm-demo.git
git push origin master
xcode 에서 존재하는 프로젝트를 git server 에 add
1. git server
1-1. remote repository 로 이동하여 다음을 차례로 수행
1-2. su git
1-3. git init --bare --shared iOS.git
2. local ( mac )
2-1. mac console 을 사용해서 존재하는 프로젝트로 이동 ( *.xcodeproj 가 존재하는 폴더 ), 예) cd /Users/pointermans/Documents/Work/iGen/iOS
2-2. console 에서 git init
2-3. console 에서 git add .
2-4. xocde - Source Control - iOS master - Configure iOS 메뉴로 선택, Remotes 탭 선택, 왼쪽 하단의 Add Remote 선택
2-5. Name 은 origin, Address 는 ssh://pointermans@git서버아이피/git-repos/iGen/iOS.git 입력, 암호 입력
2-6. xocde - Source Control - commit 후 Push 한다
1-1. remote repository 로 이동하여 다음을 차례로 수행
1-2. su git
1-3. git init --bare --shared iOS.git
2. local ( mac )
2-1. mac console 을 사용해서 존재하는 프로젝트로 이동 ( *.xcodeproj 가 존재하는 폴더 ), 예) cd /Users/pointermans/Documents/Work/iGen/iOS
2-2. console 에서 git init
2-3. console 에서 git add .
2-4. xocde - Source Control - iOS master - Configure iOS 메뉴로 선택, Remotes 탭 선택, 왼쪽 하단의 Add Remote 선택
2-5. Name 은 origin, Address 는 ssh://pointermans@git서버아이피/git-repos/iGen/iOS.git 입력, 암호 입력
2-6. xocde - Source Control - commit 후 Push 한다
2015년 3월 13일 금요일
root allow ( ssh & login ) for ubuntu
os : 3.16.0-30-generic #40~14.04.1-Ubuntu SMP
musesoft@musesoft-IdeaPad-S215:~$ sudo passwd root
[sudo] password for musesoft:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
musesoft@musesoft-IdeaPad-S215:~$ su
Password:
root@musesoft-IdeaPad-S215:/home/musesoft#
root@musesoft-IdeaPad-S215:/home/musesoft# vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
[SeatDefaults]
user-session=ubuntu
greeter-show-manual-login=ture
root@musesoft-IdeaPad-S215:/home/musesoft# vi /etc/ssh/sshd_config
#PermitRootLogin without-password
PermitRootLogin yes
shutdown -r now
musesoft@musesoft-IdeaPad-S215:~$ sudo passwd root
[sudo] password for musesoft:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
musesoft@musesoft-IdeaPad-S215:~$ su
Password:
root@musesoft-IdeaPad-S215:/home/musesoft#
root@musesoft-IdeaPad-S215:/home/musesoft# vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
[SeatDefaults]
user-session=ubuntu
greeter-show-manual-login=ture
root@musesoft-IdeaPad-S215:/home/musesoft# vi /etc/ssh/sshd_config
#PermitRootLogin without-password
PermitRootLogin yes
shutdown -r now
2015년 1월 23일 금요일
2015년 1월 22일 목요일
/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first
yum install postgresql-server
[root@localhost kamailio-4.2.2]# /etc/init.d/postgresql start
/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
[FAILED]
[root@localhost kamailio-4.2.2]# service postgresql initdb
Initializing database: [ OK ]
[root@localhost kamailio-4.2.2]# /etc/init.d/postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
[root@localhost kamailio-4.2.2]#
[root@localhost kamailio-4.2.2]# /etc/init.d/postgresql start
/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
[FAILED]
[root@localhost kamailio-4.2.2]# service postgresql initdb
Initializing database: [ OK ]
[root@localhost kamailio-4.2.2]# /etc/init.d/postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
[root@localhost kamailio-4.2.2]#
2015년 1월 15일 목요일
backup & restore with postgresql
1. Backup: $ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}
2. Restore: $ psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}
2. Restore: $ psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}
Screen Capture with Mac
shift + command + 4 : selection area capture
shift + command + 3 : full area capture
shift + command + 3 : full area capture
2015년 1월 8일 목요일
agile plugin install for redmine
1. http://redminecrm.com/ projects/agile/pages/last 에서 light 버전 다운로드
2. 다운로드 한 파일을 압축 해제 하여 redmine 서버의 /var/lib/redmine/plugins 폴더에 복사
3. plugin 설치 명령 수행
bundle install
bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
4. /etc/init.d/httpd restart
5. 신규 프로젝트 생성 시, agile 모듈을 선택
6. 생성한 프로젝트의 일감을 생성하면 agile 탭에서 이동 할 수 있음
2. 다운로드 한 파일을 압축 해제 하여 redmine 서버의 /var/lib/redmine/plugins 폴더에 복사
3. plugin 설치 명령 수행
bundle install
bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
4. /etc/init.d/httpd restart
5. 신규 프로젝트 생성 시, agile 모듈을 선택
6. 생성한 프로젝트의 일감을 생성하면 agile 탭에서 이동 할 수 있음
backup for redmine
redmine version : 2.4.3.stable
mysql version : 5.2.73
redmine db backup
1. mysqldump -u root -ppassword redmine | gzip > /var/tmp/20150108_redmine_db_backup.gz
1. mysqldump -u root -ppassword redmine | gzip > /var/tmp/20150108_redmine_db_backup.gz
redmine files backup
1. rsync -a /var/lib/redmine/files /var/tmp/files
2. cd /var/tmp/files
3. tar -czvf 20150108_redmin_file_backup.tar.gz files
1. rsync -a /var/lib/redmine/files /var/tmp/files
2. cd /var/tmp/files
3. tar -czvf 20150108_redmin_file_backup.tar.gz files
피드 구독하기:
글 (Atom)