Skip to content

Instantly share code, notes, and snippets.

@liuanyou
liuanyou / ubuntu_save_brightness.md
Last active Aug 11, 2017
Ubuntu 12.04 LTS - a workaround to save brightness
View ubuntu_save_brightness.md

####Issue :

My Dell OptiPlex 3030 Unbuntu machine cannot save brightness, it goes to maximum brightness every time I save to lower brightness and reboot. It looks like related to Ubuntu. I found out a solution for it.

####Workaround :

  1. Modify grub file

    In terminal, type command to open grub file

@liuanyou
liuanyou / javascript_prototype.md
Last active Aug 11, 2017
JavaScript - 原型
View javascript_prototype.md

每个对象都连接到一个原型对象,并且它可以从中继承属性。所有通过对象字面量创建的 对象都连接到Object.prototype,它是JavaScript中的标配对象。

当你创建一个新对象时,你可以选择某个对象作为它的原型。JavaScript提供的实现机制 杂乱而复杂,但其实可以被明显地简化。我们将给Object增加一个create方法。这个方法 创建一个使用原对象作为其原型的新对象。

if (typeof Object.beget !== 'function') {
    Object.create = function (o) {
        var F = function () {};
@liuanyou
liuanyou / IEI_industrial_panel_pc_install_windows_7_professional_sp1.md
Last active Aug 11, 2017
IEI Industrial Panel PC afl-19i-hm55i7-62/r/2g-r21 - install Windows 7 Professional SP1
View IEI_industrial_panel_pc_install_windows_7_professional_sp1.md
  1. Put Windows 7 Profession PS1 DVD into DVD-Room, restart the machine, enter F2 to get into BIOS
  2. Change BOOT OPTION # 1 to use DVD media, press F4 to save and exit
  3. Install Windows 7 as guided, it will have several reboot during installation
  4. After installation is finished, open Device Manager to check what drivers are missing
  5. Download Ethernet_gKINO-DMF for network adapter driver on another computer, and copy to this Panel PC get the driver from IEI web site https://www.ieiworld.com/en/support/con_show.php?cid=4
  6. After network adapter driver is installed, machine is ready to cable to connect to Internet
  7. Download other drivers as needed, in my case, don't find drivers to 2 devices 'Unkown Device' and 'PCI-bus Communication Cards (PCI-1600 Series)'
@liuanyou
liuanyou / Oracle_XE_recover_database_from_dbf_files.md
Last active Aug 22, 2020
Oracle XE - recover database from dbf files
View Oracle_XE_recover_database_from_dbf_files.md
  1. Open Command Line window, type command

    sqlplus sys/ as sysdba

  2. Type command

    shutdown immediate;

  3. Backup and delete local datafile(s) from C:\oraclexe\app\oracle\oradata\XE
  4. Backup and delete local log file(s) from C:\oraclexe\app\oracle\fast_recovery_area\XE\ONLINELOG
  5. Copy all dbf file(s) and tmp file (data file of temporary tablespace) to C:\oraclexe\app\oracle\oradata\XE
  6. Copy redo log file to C:\log (create folder if not exists)
  7. Open Command Line window, type command

    sqlplus sys/ as sysdba

@liuanyou
liuanyou / IEI_industrial_panel_pc_fix_devices_without_drivers_cdrom_kavbootc.md
Last active Aug 11, 2017
IEI Industrial Panel PC afl-19i-hm55i7-62/r/2g-r21 - fix devices without drivers, cdrom and kavbootc
View IEI_industrial_panel_pc_fix_devices_without_drivers_cdrom_kavbootc.md
  1. Disable devices which can't find drivers in Device Manager XXX-PC_Device_Manager.png
  2. Disable cdrom service, change Start to 3 for key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\cdrom in Registry Editor XXX-PC_Regedit_cdrom.png
  3. Disable kavbootc service, change Start to 3 for key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\kavbootc in Registry Editor XXX-PC_Regedit_kavbootc.png
@liuanyou
liuanyou / GlassFish_asadmin_commands.md
Last active Sep 12, 2017
GlassFish asadmin commands
View GlassFish_asadmin_commands.md
  1. Install GlassFish Server 4.0
  2. Run Command Line window as administrator
  3. Type

    cd <GlassFish_Home>/bin

Create domain

asadmin create-domain <domain_name>

Delete domain

asadmin delete-domain <domain_name>

Start domain

asadmin start-domain <domain_name>

@liuanyou
liuanyou / Oracle_XE_change_SID.md
Last active May 8, 2020
Oracle XE - change SID
View Oracle_XE_change_SID.md
  1. Install Oracle Database 11g Express Edition
  2. Run Command Line window as administrator, type

    sqlplus sys/ as sysdba

  3. Type

    show parameter spfile;

  4. Type

    shutdown immediate;

  5. Type

    startup mount;

@liuanyou
liuanyou / Windows_kill_stopping_status_service_forcely.md
Last active Sep 20, 2017
Windows kill stopping status service forcely
View Windows_kill_stopping_status_service_forcely.md
  1. Run Command Line window as administrator

  2. Type command

    sc queryex <service_name>

    Get process PID from the output

  3. Type command

    taskkill /pid <PID> /f

  4. Go to Computer Management, check if service is stopped compeletely

@liuanyou
liuanyou / Wildfly_deploy_activemq_failed_caused_by_server_directory_contains_space.md
Last active Feb 2, 2018
Wildfly deploy activemq failed caused by server directory contains space
View Wildfly_deploy_activemq_failed_caused_by_server_directory_contains_space.md

When deploys ear which depends on activemq in Wildfly, get .failed file which has below content:

"{"WFLYCTL0180: Services with missing/unavailable dependencies" => [ "jboss.deployment.subunit.\"project-sff-e30003549-ear.ear\".\"project-sff-e30003549-server.war\".component.AstroMsgHandler.CREATE is missing [jboss.ra.activemq-rar]", "jboss.naming.context.java.module.project-sff-e30003549-ear.project-sff-e30003549-server.env.\"enisco.emes.project.sff.e30003549.server.astro.XmlMsgSender\".connFactory is missing [jboss.naming.context.java.jboss.IBMMQConnectionFactory]" ]}"

The error message says jboss.ra.activemq-rar is missing, actually activemq is configured correctly.

Finally, it is found out that Wildfly installation directory contains space, eg C:\install directory\Wildfly. When deploys activemq module,

You can’t perform that action at this time.