snipt

Ctrl+h for KB shortcuts

Bash

Change Linux hostname without reboot

1
2
3
vim /etc/hostname
vim /etc/hosts
hostname new-hostname
https://snipt.net/embed/b4d8178ec8afc5351a2dd41a01b06cd7/
/raw/b4d8178ec8afc5351a2dd41a01b06cd7/
b4d8178ec8afc5351a2dd41a01b06cd7
bash
Bash
4
2019-06-25T13:25:55
True
False
False
/api/public/snipt/6656/
change-linux-hostname-without-reboot-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>vim /etc/hostname </span><span id="L-2"><a name="L-2"></a>vim /etc/hosts </span><span id="L-3"><a name="L-3"></a>hostname new-hostname </span></pre></div> </td></tr></table>
hostname, reboot

Bash

Set dns servers

1
2
3
vi /etc/resolv.conf
nameserver <dns1_ip_address>
nameserver <dns1_ip_address>
https://snipt.net/embed/7d30bcb0dc962736575e81383326aed9/
/raw/7d30bcb0dc962736575e81383326aed9/
7d30bcb0dc962736575e81383326aed9
bash
Bash
3
2019-06-25T13:26:03
True
False
False
/api/public/snipt/6655/
set-dns-servers-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>vi /etc/resolv.conf </span><span id="L-2"><a name="L-2"></a>nameserver &lt;dns1_ip_address&gt; </span><span id="L-3"><a name="L-3"></a>nameserver &lt;dns1_ip_address&gt; </span></pre></div> </td></tr></table>
dns, servers

Bash

Find all files in /etc owned by root that have been modified within the last day

find /etc -user root -mtime -1 
https://snipt.net/embed/e599976da5976840dabdeabac115a3ad/
/raw/e599976da5976840dabdeabac115a3ad/
e599976da5976840dabdeabac115a3ad
bash
Bash
1
2019-06-25T13:26:12
True
False
False
/api/public/snipt/6654/
find-all-files-in-etc-owned-by-root-that-have-been-modified-within-the-last-day-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>find /etc -user root -mtime -1 </span></pre></div> </td></tr></table>
root

Bash

Basic Unix/Linux Installation

1
2
3
4
5
./configure 
make 
make install 
dpkg -i pkg.deb – install a package (Debian) 
rpm -Uvh pkg.rpm – install a package (RPM) 
https://snipt.net/embed/2a054ebef85df372661314e706ce1ea4/
/raw/2a054ebef85df372661314e706ce1ea4/
2a054ebef85df372661314e706ce1ea4
bash
Bash
5
2019-06-25T13:26:19
True
False
False
/api/public/snipt/6653/
basic-unixlinux-installation
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>./configure </span><span id="L-2"><a name="L-2"></a>make </span><span id="L-3"><a name="L-3"></a>make install </span><span id="L-4"><a name="L-4"></a>dpkg -i pkg.deb – install a package <span class="o">(</span>Debian<span class="o">)</span> </span><span id="L-5"><a name="L-5"></a>rpm -Uvh pkg.rpm – install a package <span class="o">(</span>RPM<span class="o">)</span> </span></pre></div> </td></tr></table>
install

Bash

send direct message on twitter in linux terminal

curl -u username:password -d user="reciever" text="the message" http://twitter.com/direct_messages/new.xml
https://snipt.net/embed/c95e10a79fd0f803a4febb2c5ccc26eb/
/raw/c95e10a79fd0f803a4febb2c5ccc26eb/
c95e10a79fd0f803a4febb2c5ccc26eb
bash
Bash
1
2019-06-25T13:26:24
True
False
False
/api/public/snipt/6652/
send-direct-message-on-twitter-in-linux-terminal-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>curl -u username:password -d <span class="nv">user</span><span class="o">=</span><span class="s2">&quot;reciever&quot;</span> <span class="nv">text</span><span class="o">=</span><span class="s2">&quot;the message&quot;</span> http://twitter.com/direct_messages/new.xml </span></pre></div> </td></tr></table>
linux, twitter