Saturday, September 24, 2016

Configure opensource driver for Radeon HD 7950 on Ubuntu 16.04

$ sudo apt-get remove fglrx*
$ sudo apt-get purge fglrx*


 
Opensource drivers should be installed by default, 
If not installed you can use the following command:
 
$ sudo apt-get install xserver-xorg-video-ati
$ xrandr -q
 
Xrandr was not able to recognize my graphic card. 
So I used this trick from ubuntu wiki.
 
$ cd /usr/share/X11/xorg.conf.d/
$ sudo nano 99-vesahack.conf
...
Section "Device"
    Identifier "Screen0"
    VideoRam 10000
EndSection 
...
$ sudo reboot  
 
Optional fix resolution for grub. 
You might need to try 'vbeinfo' in grub to see what resolutions are supported.
 
$ sudo nano /etc/default/grub
...
GRUB_GFXMODE=1920x1080 
...
$ sudo update-grub 
 
Update:
Purge command removed fglrx-core and flgrx which was causing a conflict.
Xrandr is able to recognize the graphic card, so 99-vesahack.conf is removed. 
 
Ref:
http://askubuntu.com/questions/159586/how-to-install-radeon-open-source-driver#277500
https://wiki.ubuntu.com/X/Config/Resolution

Thursday, September 22, 2016

Configure Prosody 0.9 for ChatSecure iOS push notifications

ChatSecure iOS now supports push notifications (XEP- 0357). Some limitations include limited to single client use and dependency on ChatSecure Push Server. However, this is good step forward and I welcome it. 

Good Read: https://github.com/ChatSecure/ChatSecure-Push-Server/tree/master/docs/v3

Included below is a brief guide to set up SSL which is a requirement for being able to send push notifications. Self signed certificates did not work for me. Please read reference for more info.

Make directory for non core modules:

# cd /etc/prosody/
# mkdir noncoremodules
# chown root:prosody noncoremodules/

Download mod_cloud_notify:

# cd /etc/prosody/noncoremodules/
# wget https://hg.prosody.im/prosody-modules/raw-file/tip/mod_cloud_notify/mod_cloud_notify.lua

(Alternate method in References)

Edit prosody config file:
Global Section

# cd /etc/prosody
# nano prosody.cfg.lua
...
modules_enabled = {   
        -- Non core plugins
                "cloud_notify"; -- Push Notifications
};

...
...
plugin_paths = { "/etc/prosody/noncoremodules/" } -- Path to non-core plugins 
...

(Note the module name is written as cloud_notify not mod_cloud_notify)

SSL using StartSSL:

Start the 'Validation Wizard' and validate your VirtualHost/Domain through email. We will use 'example.com' as the VirtualHost.

Start the 'Certification Wizard' for example.com
 

Generate CSR using prosodyctl on server
 

# prosodyctl cert request example.com 
# cd /var/lib/prosody
# cat example.com.req

 

Copy to CSR Box and run. Download Certificates zip file.

Extract OtherServer.zip 

1_Intermediate.crt 
2_example.com.crt 
root.crt


$ cat 1_Intermediate.crt >> 2_example.com.crt
$ scp 2_example.com.crt root@example.com:/var/lib/prosody/


(Intermediate certificate needs to be appended main certificate. Since I downloaded on my personal laptop I needed to scp the file to the server. This is not needed if the files are downloaded directly to server)

# chown prosody:prosody 2_example.com.crt
# chmod 600 2_example.com.crt 

 

Edit prosody config file: 
VirtualHost Section


# nano /etc/prosody/prosody.cfg.lua
...
VirtualHost "example.com"
        enabled = true
        ssl = {
                key = "/var/lib/prosody/example.com.key";
                certificate = "/var/lib/prosody/2_example.com.crt";
        }
...
 

Restart Prosody
 
# sudo -u prosody prosodyctl start

References:

https://prosody.im/doc/installing_modules#prosody-modules
https://prosody.im/doc/certificates
https://github.com/ChatSecure/ChatSecure-iOS/issues/557



Friday, September 2, 2016

Error: ORA-28001: the password expried (OracleDB Schema Password)

Symptoms: 
Oracle Hyperion Financial Management, managed services stopping immediately after starting

Logs: 
C:\Oracle\Middleware\user_projects\domains\EPMSystem\servers\HFMWeb0\logs\HFMWeb0
####<Sep 2, 2016 10:14:00 AM IST> <Error> <Deployer> <WIN-2GMS0JCRA42> <HFMWeb0> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1472791440187> <BEA-149205> <Failed to initialize the application 'hfm_datasource' due to error weblogic.application.ModuleException: .
weblogic.application.ModuleException:
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:327)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:518)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:47)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:649)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
    at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:44)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
    at weblogic.deploy.internal.targetserver.SystemResourceDeployment.prepare(SystemResourceDeployment.java:55)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:40)
    at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
    at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:22)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:166)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:181)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:97)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: ORA-28001: the password has expired

Solution 1:
Shutdown Hyperion Services make changes using SQL plus and then restart services.

SQL> connect sys@HYPDB as sysdba
(Note: Your database name might be different)
(e.g. Database: HYPDB, HFM Schema: HFMDB)

SQL> select username, account_status from dba_users;
(Check is user account is expired/locked)
...
USERNAME                       ACCOUNT_STATUS
------------------------------     --------------------------------
HFMDB                              EXPIRED & LOCKED
FDMEEDB                         EXPIRED & LOCKED
HSSDB                               EXPIRED & LOCKED
EPMADB                           EXPIRED & LOCKED
...

SQL> alter user HFMDB identified by Password123;
(Update expired password)

SQL> alter user HFMDB account unlock;
(Unlock locked account)

Solution 2:
Set schema to never expire
Ref: https://stackoverflow.com/questions/1095871/how-do-i-turn-off-oracle-password-expiration#6777079

SQL> select profile, username from DBA_USERS;
(Note the profile name for the schema. My case its DEFAULT)

SQL> alter profile DEFAULT limit password_life_time UNLIMITED; 

SQL> select resource_name,limit from dba_profiles where profile='DEFAULT';

(Double check if change is made)
(Note schema will still show expired. So follow Solution 1 last two steps)

Monday, August 15, 2016

Torrents on Android using Free/Libre Software

*This article is made for educational purposes. Please share/download files responsibly. Here is good places to get legal torrents

The few of you who download content directly to your Android phone must already be familiar with the Bittorrent client for Android. However, just recently I experimented and found a Free/Libre Software alternative.

Prerequisites :
Termux (Play Store Link)
Transdrone (Play Store Link)
*Root required
(These apps are available on F-Droid)

1. Install Termux and Transdrone
Links above. Open Termux.
Now would be a good time to update Termux and install some optional packages
apt update
apt install man

2. Install Transmission
Open Termux.
apt install transmission

3. Start Transmission with no authorization
transmission-daemon -T
(Remote client access wont be activated so there wont be a security issue. Alternatively, you can create user/password if you feel that paranoia itching under the skin)

4. Start Transdrone and config
Menu > Settings > Add new server > Add normal,custom server
Server Type : Transmission
IP : localhost
Done



 5. File Management
Files will be downloaded to /data/data/com.termux/files/home/Downloads
*Root will be required to move the files from Termux to a useful directory e.g.
cp /data/data/com.termux/file/home/Downloads/file.txt /sdcard/

You now are no longer tethered to Bittorrent for Android. Have fun!