Author: Petronald Green

7

How to fix 550 recvq/fax000000005.tif: Operation not permitted

So you setup your elastix or HylaFAX Server and you can’t save or download any of the faxes in your client. Most likely its an issue where your permissions are not set on the downloaded files.

To check, go to the received fax directory on the server and check the permissions on your .tif files.

[root@pbx recvq]# ls -la /var/spool/hylafax/recvq/
total 64
drwxrwxrwx 2 uucp uucp 4096 Oct 14 12:22 .
drwxr-xr-x 17 uucp uucp 4096 May 3 14:53 ..
-rw------- 1 uucp uucp 12962 Oct 14 11:20 fax000000005.tif
-rw------- 1 uucp uucp 14832 Oct 14 11:31 fax000000007.tif
-rw------- 1 uucp uucp 1 Oct 14 11:30 seqf

As you can see in my case the files are only readable by uucp. so lets

chmod 666 fax*.tif

Now open your Halyfax client (I use YajHFC), refresh and ensure you can now view your faxes. Most likely now you can, so lets tweak our modem config and make sure future files save properly.

In your modem config file (located in /var/spool/hylafax/etc/config.YourModem [In my case it was config.ttyIAX1]) we want to change the following

RecvFileMode:           0666

Save and you’re done!

 

Other Notes:

If chmod 666 didn’t work try chmod 777
On your client ensure passive mode is disabled.

0

How to disable popup banner in tapatalk

 

In your mobiquo/smartbanner/ folder, locate the file called head.inc.php

Create two new variables near the top of the file

$app_ads_enable = 0;
$app_banner_enable = 1;

$app_ads_enable – sets the fullscreen banner when a user first goes to your forum
$app_banner_enable – sets the ‘twitter card head’ (the opt-in screen at the start of the page)

0 will disable a feature,
1 will enable the feature.

Enjoy!

3

How to increase scope (change netmask) in windows server 2012

As you may have noticed, there is no easy way to change the netmask of a scope. The only way is to delete and recreate it.

If you have a network anywhere near as complex as the one I’m dealing with right now, you KNOW manual insertion is not even remotely an option. Luckily there is an easy way…. command prompt 🙂

 

Step 1. open up cmd as administrator and export your scope

The command is:

C:>netsh dhcp server \dhcp_server_name scope my_scope dump>c:dhcp.txt

eg. C:>netsh dhcp server \dc1 scope 192.168.1.1 dump>c:dhcp.txt

 

Step 2. Open that document and find the line saying

Dhcp Server \xyz.domain.local add scope 10.0.10.0 255.255.255.0 “scope_name” “scope_description”

and change the netmask to whatever you wish it to be… In my case I changed to 255.255.254.0 for an extra 255 Ip addresses so instead of 192.168.1.1-254 I have 192.168.1.1 – 192.168.2.254

 

Step 3. Delete your scope…

Yes, delete your scope… Be sure that you have opened up the dhcp.txt and confirmed that all your reservations and other configurations are stored in there. (Note. delete using the default GUI MMC console)

 

Step 4. Import modified scope. 

I called my modified scope dhcp_custom.txt and so I will import it with

C:>netsh exec c:dhcp_custom.txt

 

done and done!! 

 

How to solve inconsistent PHP times 0

How to solve inconsistent PHP times

Most likely, the issue is with your php server randomly choosing a timezone and therefore having times which are usually either one hour behind or one hour after..

To solve it, right before the ‘mission critical’ area of your script, use date_default_timezone_set() .

An example of this is

date_default_timezone_set('America/Dominica');

Note: you can test your timezone with

echo date_default_timezone_get();

 

How to add and subtract fom time in MySQL 0

How to add and subtract fom time in MySQL

Luckily for us there is an ADDTIME function we can use to add and remove from times… The syntax is as follows: ADDTIME(datetime,time_to_change) example

SELECT `emp_id` , `clock_time` , ADDTIME( '-01:00:00', `clock_time` ) AS new_time
FROM `timeclock`

Will return

emp_id clock_time new_time
10059 08:30:55 07:30:55
10059 08:31:06 07:31:06
10059 08:31:28 07:31:28
10046 08:33:44 07:33:44

An Update example

UPDATE `timeclock` SET `clock_time` = ADDTIME( '-01:00:00', `clock_time` ) WHERE `id` BETWEEN 40967 AND 41022
0

How to make iptables rules permanent

To setup persistant iptables rules, after we enter our iptables as usual, we export them to config file.

iptables-save > /etc/iptables.conf

Edit your global rc.local file [/etc/rc.local] with your favorite editor and before the ‘exit 0’ add:

iptables-restore < /etc/iptables.conf

Save and restart, your iptables rules are now permanent

mysqlnd vs libmysql 0

mysqlnd vs libmysql

TL:DR If you are using php 5.3.3 or newer then go mysqlnd, otherwise stay with the default libmysql.

Whats the difference? While I could post it here for you, a more updated source would be http://www.php.net/manual/en/mysqlinfo.library.choosing.php.

As you can see, currently mysqlnd does ‘pretty-much’ evrything libmysql does with a plethora of additional features. So why on earth is that even a valid question? Well.. its not… at least not currently… If we move a few years in the past, mysqlnd did not support compression or SSL, which was in many cases a deal breaker. As of PHP 5.3.3 all of these are supported and it just makes more sense to go with the native driver.

Personally I use mysqlnd because I love using fetch_all. So, how to install? Follow below:

apt-get remove php5-mysql
apt-get insall php5-mysqlnd

(Note. you may have to reinstall anything that depended on mysql, such as phpmyadmin)
0

How to get mssql to work on php (debian/ubuntu)

Assuming that you already have PHP installed, you enter into the console

 apt-get install php5-sybase

(sadly not as intuitive as apt-get install php5-mssql)

For most instances that may be enough to give you what you need. If by any chance that doesn’t work, or you need more ‘functionality’ you can try (untested by me)

apt-get install php-pear
pear install --nodeps MDB2_Driver_mssql
How to check active connections on web server 0

How to check active connections on web server

Now this isn’t the most accurate method out there but it is by far the easiest.

Open up your console and type
 netstat -an | grep :443 | grep ESTABLISHED | wc -l

 

or even better, for a running total

watch "netstat -an | grep :443 | grep ESTABLISHED | wc -l"

 

Just to add one more not without getting too technical

netstat -an | grep :443 | grep -v TIME_WAIT | wc -l

should give you all connections that the local server hasn’t closed, depening on your application, this may be more accurate

0

How to sync time with NTP server in windows

To sync your time with a known local timeserver/domain controller, open up CMD (preferably with administrative privileges) and type

net time timeserver /set /yes

 

If you instead want to sync with an external time server.

w32tm /config /syncfromflags:manual /manualpeerlist:pool.ntp.org /reliable:no /update

 

Another useful command to note is:

w32tm /stripchart /computer:si.pool.ntp.org /samples:5 /dataonly

this will check the difference between current time and external ntp server.