Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- CURL



  Resolving error "SSL certificate problem: self signed certificate in certificate chain"

In a PHP application, cURL is frequently used to make connection to remote server to request some resource. It can be used to transfer data with different protocols such as HTTP, HTTPS, FTP etc. While using cURL in PHP, someone may get an error with message similar to "SSL certificate problem: self signed certificate in certificate chain". This may happen when cURL tries to make a SSL connection server and the server returns a server certificate which is self-signed and it's not trusted by the c...

   PHP,SSL,CURL,TWILIO     2016-06-26 07:17:23

  Accessing Reddit top posts using OAuth

Previously one can use the https://www.reddit.com/r/rprogramming/top.json API to access one subreddit's top posts. This API doesn't require any access token to fetch the data. However, this API may not work all the time. Reddit may block the API's request if it finds that you are using a script or some app which accesses the API now and then. For an app or script which needs to fetch the data routinely, what should we do? Reddit provides one method which can be used to fetch this kind of to...

   REDDIT,OAUTH,TOP POSTS,HOT POSTS     2023-12-16 07:24:14

  Sending message to Slack Incoming Webhook using PHP

Slack is a popular work collaboration tool and it provides many features which help teams collaborate. It has one function which allows sending messages to channels from external source such as your own web service -- Incoming Webhook. This is extremely useful when want to monitor something and get notified when some event occurs and it doesn't require complicated setup. To send messages using Incoming Webhook, a service URL has to be generated on Slack and then the message can be posted to this...

   PHP,CURL,SLACK,INCOMING WEBHOOK     2017-03-11 21:32:28

  Something you may not know about Shell

Shell is also called command line interface, it is the interface between *nix users and computer. Shell is a program which provides service to access OS kernel services. This article is to introduce some not so well known but useful and interesting knowledge about shell. Wiki shell was born almost at the same time as Unix. The first UNIX shell was written by Ken Thompson in 1971 and its name is Thompson sh. It's older than Linux kernel. The default Shell in most *nix and MacOS is bash, bash was...

   Linux, Unix,Shell,Command     2012-11-24 07:19:47

  Understanding PGO in GoLang 1.20

Background The Go 1.20 version was officially released in February 2023, it introduced the PGO(Profile Guided Optimization) mechanism. The basic principle of PGO can be divided into the following two steps: First, profiling is performed on the program to collect data about the program's runtime and generate a profiling file. When compiling the program, enable the PGO option, and the compiler will optimize the program's performance based on the content in the .pgo file. When compiling a program...

   GO 1.20,PGO,GOLANG     2023-02-28 04:27:46

  A guide on installing and setting up GitLab server on Ubuntu

GitHub, GitLab and BitBucket are the three most famous code hosting platform in the world. They have different features which allow teams or individuals to share code with others remotely. In case you want to build your own code hosting server so that you can host and share the code by yourself, you can install and set up your own server. In this post, we will walk you through a guide on installing and setting up GitLab server on Linux environment. gitlab is a web based code hosting tool which i...

   UBUNTU,TUTORIAL,GITLAB     2020-04-25 07:05:33

  PHP Multithreading – Faking It

PHP doesn’t really support multi-threading per se but there are ways to do “fake” multithreading. Here’s one I saw in the PHPClasses.org newsletter – Multi-thread Simulation. Note that this class is intedend for use on a webserver, as opposed to running PHP scripts from a command line (or similar). Check the end of this post for some alternatives you can try if you’re using PHP as a stand-alone scripting language. Now, I’m going to be lazy and just ...

   PHP,Multithreading,Possible,CURL,Fake,Si     2011-09-04 23:07:22

  PHP to integrate with Sign in with Google

Google has a huge user base and hence it provides an authentication service for third party service to integrate with them so that people can sign in with Google in their services. Google also adopts OAuth 2 to provide this kind of Open ID connect service. This post will introduce how to integrate with sign in with Google functionality in your PHP website.  Create a client app on Google The first step you should follow is to create a Google app, you can follow the post here to create the p...

   PHP,GOOGLE API,OPEN API,SIGN IN WITH GOOGLE     2019-03-03 02:00:09

  9 reasons to use Zsh

Like majority *nix users, I have been using bash for many years. Sometimes I feel uncomfortable with bash. I tried use some other shells as well such as ksh, tcsh and zsh which I am going to talk about. A few days ago, I found an open source project ranking in the 6th named oh-my-zsh on Github, I downloaded it and had a try with it. It's amazing. We should use zsh to replace bash now. Why do we need to use zsh? Here is a 4 minutes YouTube video which shows many reasons why we should switch from ...

   zsh, advantage, command     2012-09-28 12:46:39

  Install multiple versions of Go

As a developer, there might be need in some cases to have multiple versions of Go installed. One may test out some new features of the latest version of Go but also wanna maintain a stable version of Go for daily development purpose. How to maintain multiple versions of Go? The GoLang official website has provided a way to maintain multiple versions of Go by using go get to install the different versions of Go. Below are steps: Download a normal version of Go and install it Go to the Go release...

   MULTIPLE VERSION,GO BINARY,GO VERSION     2021-05-16 02:01:46