sudo umount -a -t cifs -l
-l
,--lazy
:unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon as it is not busy anymore.
reference:Force Unmount a CIFS Share in Linux
軟體開發、伺服器和生活瑣事
sudo umount -a -t cifs -l
-l
, --lazy
:unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon as it is not busy anymore.reference:Force Unmount a CIFS Share in Linux
假設有個 class:
class Woker { protected Queue $queue; public function run() { while (!$this->queue->isEmpty()) { $job = $this->queue->pop(); // do something } } }
用 PHPUnit 建立 stub 以後,必須使用 reflection 來自訂 $queue
property:
$worker = $this->getMockBuilder(Worker::class) ->disableOriginalConstructor() ->getMock(); $queue = $this->createMock(Queue::class); $queue->expected($this->atLeast(1)) ->method('isEmpty') ->willReturn(true); // PHP Reflection on $worker $refProperty = new \ReflectionProperty($worker, 'queue'); $refProperty->setAccessible(true); $refProperty->setValue($crawler, $queue);
這樣寫 test case 蠻髒的,有點想要換 test framework ….
從專案的時間軸上,在要縮時 (調整速度) 的影片點滑鼠右鍵,並在選單中選擇「Change Speed」:
若要讓影片以二倍速度播放,則填入「200%」,以此類推:
假設要讓 google-cloud-cli
套件維持在目前的版本、不更新,可以使用 apt-mark
鎖定版本:
apt-mark hold google-cloud-cli
若不再需要鎖定版本,則使用 unhold
解除鎖定:
apt-mark unhold google-cloud-cli
使用 pip install
時,會自動解決 dependency 並自動安裝需要的 packages,但是 pip uninstall
並不會處理 dependency,所以只會移除指定的 package。
若需要在 uninstall 時,自動將偵測並移除不需要的 packages:
pip-autoremove mailgun mailgun 0.1.1 (/home/zero/tmp/python/whois/lib/python3.8/site-packages) pyactiveresource 1.0.1 (/home/zero/tmp/python/whois/lib/python3.8/site-packages) Uninstall (y/N)?