Install Tinyproxy on Centos 7
Install Tinyproxy on Centos 7 Read More »
I would like to query the data that I need only from a server to another server, and I just use one line of command in linux shell [code lang=”shell”] mongoexport -h fromHost.com -d fromDB -c fromCollection -q ‘{ count: { $gte: 1 } }’ | mongoimport -h toHost.com -d toNewDB -c toNewCollection [/code] If
mongoexport and mongoimport with query from one host to one host Read More »
I need to find out the duplicate data content in my 40 Millions records, then I can make the unique index to my name field. [code lang=”shell”] > db.collecton.aggregate([ … { $group : {_id : "$field_name", total : { $sum : 1 } } }, … { $match : { total : { $gte :
Fast way to find duplicate data in MongoDB Read More »
You may found this error from your php-fpm and the php-fpm crash [code lang=”shell”] tail /var/log/php-fpm/error.log [15-May-2016 12:24:13] ERROR: failed to ptrace(PEEKDATA) pid 17402: Input/output error (5) [15-May-2016 12:24:13] ERROR: failed to ptrace(PEEKDATA) pid 17777: Input/output error (5) [15-May-2016 12:24:13] ERROR: failed to ptrace(PEEKDATA) pid 18886: Input/output error (5) [15-May-2016 12:25:53] ERROR: failed to ptrace(PEEKDATA)
ERROR: failed to ptrace(PEEKDATA) pid 17402: Input/output error (5) Read More »
After I install MongoDB 3.2.3 in Centos 7, I received this error when I start mongo in shell. Solution Create the init.d script. Create the following file at /etc/init.d/disable-transparent-hugepages: Make it executable. Run the following command to ensure that the init script can be used:
WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’. Read More »
[code lang=”shell”] [root@master ~]# mongo MongoDB shell version: 3.2.3 connecting to: test Server has startup warnings: 2016-02-29T23:11:36.666+0700 I CONTROL [initandlisten] 2016-02-29T23:11:36.667+0700 I CONTROL [initandlisten] ** WARNING: Cannot detect if NUMA interleaving is enabled. Failed to probe "/sys/devices/system/node/node1": Permission denied 2016-02-29T23:11:36.667+0700 W CONTROL [initandlisten] 2016-02-29T23:11:36.667+0700 W CONTROL [initandlisten] Failed to probe "/sys/kernel/mm/transparent_hugepage": Permission denied 2016-02-29T23:11:36.667+0700 W
I need to find some string in all folders. [code lang=”bash”] grep -rnw ‘./folder/’ -e “search-text” [/code] Note: -r is recursive -n is line number -w stands match the whole word
Finding all files containing a text string on Linux or Mac Read More »
I want to mass rename hundred of filenames like filename 001.jpg to filename-001.jpg … … … filename 099.jpg to filename-099.jpg I use this command to rename all in few seconds in my MacBook Pro. I think it is fine to run in any linux. [code lang=”bash”] for f in *\ *; do mv "$f" "${f//
Fastest way to rename filenames with space to dash in linux Read More »
You received error from the sed command in Mac, because the argument in mac is different. If you type in Mac terminal, you may receive error like this [code lang=”bash”] Justins-MacBook-Pro:2 juzhax$ sed -i ‘s/old_text/new_text/g’ example.txt sed: 1: "config.php": command c expects \ followed by text [/code] The first argument should be the extension of
command c expects followed by text error in Mac Read More »