• Home
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
  • CMS
    • Magento
    • Yahoo! Store

How to write to Google Sheet with API in PHP

Wednesday, 16 March 2022 15:28
Tim Ramsey
0 Comments
  1. Get a service account key from https://console.cloud.google.com/apis/credentials (You can here also restrict what this keys is allowed todo)
    1. When creating, make sure you click the Furnish a new private key
    2. Select JSON when it asks you how to download the key.
  2. The service account key you have just generated includes a client_email.
    1. Go to you google spreadsheet and allow this client_email to have write access on this document
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$sheet_name = "Sheet1";
$google_client = new \Google_Client();
$google_client->setApplicationName('Google Sheets Updater');
$google_client->setScopes([\Google_Service_Sheets::SPREADSHEETS]);
$google_client->setAuthConfig(storage_path('jsondownload.json'));
$service = new \Google_Service_Sheets($google_client);
$spreadsheet_id = 'your_sheet_id';
$range = $sheet_name.'!A:C';
$params = [
   'valueInputOption' => "USER_ENTERED"
];
$value_array = ["1","2","3","4","5","6"];
$body = new \Google_Service_Sheets_ValueRange([
   'values' => [$value_array]
]);
$service->spreadsheets_values->append($spreadsheet_id, $range, $body, $params);

https://stackoverflow.com/questions/44045183/access-google-spreadsheet-api-without-auth-token

How to Migrate FreePBX server to a new server

Saturday, 22 January 2022 22:42
Tim Ramsey
0 Comments

-Install FreePBX on New Server
-Run a full backup on current server
-Deactivate the license on the current server – https://portal.sangoma.com/deployments
-Activate new server via SSH – fwconsole sysadmin activate deployementID
-Run a restore on the new server using the backup file from step above
-Change External Address from Settings > SIP Settings to new IP Address
-Update Firewall settings with new IP Address

Unifi Controller Java CPU 100%

Wednesday, 19 January 2022 14:52
Tim Ramsey
0 Comments

If java is using too much CPU you can try the following modification. I was using a 1GB Memory droplet from Digital Ocean, but I needed to upgrade to 2GB to be able to make this adjustment.

1
2
3
4
sudo nano /usr/lib/unifi/data/system.properties
unifi.xmx=2048
unifi.xms=2048
sudo service unifi restart

While I didn’t make this additional adjustment, Unifi says you can enable a high-performance garbage collector with the following setting.

1
unifi.G1GC.enabled=true

https://help.ui.com/hc/en-us/articles/115005159588-UniFi-How-to-Tune-the-Controller-for-High-Number-of-UniFi-Devices

It looked good for about 4 hours, but then it spiked to 100% again. I tried upgrading MongoDB, so we will see

1
2
3
4
5
6
7
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
echo "manual" | sudo tee /etc/init/mongod.override
sudo service unifi stop
sudo apt-get install -y mongodb-org
sudo service unifi start

Update Unifi Controller on Linux

Wednesday, 12 January 2022 21:11
Tim Ramsey
0 Comments

If you have a controller on a Linux box, use the following commands to update the system and install the new update

1
2
3
4
5
6
7
8
9
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
#https://www.ui.com/download/unifi/
#SOFTWARE
#UniFi Network Application 6.5.55 for Debian/Ubuntu Linux and UniFi Cloud Key
wget https://dl.ui.com/unifi/6.5.55/unifi_sysvinit_all.deb
sudo dpkg -i unifi_sysvinit_all.deb
sudo reboot

Page 1 of 15

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • …
  • 15
  • Next

Categories

  • CMS
    • Magento
    • Shopify
    • Yahoo! Store
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
    • SVN
  • VOIP

Recent Posts

  • How to write to Google Sheet with API in PHP
  • How to Migrate FreePBX server to a new server
  • Unifi Controller Java CPU 100%
  • Update Unifi Controller on Linux
  • Code Signing Desktop App