New pages
From ben.goodacre.name/tech
(Latest | Earliest) View (newer 50 | older 50) (20 | 50 | 100 | 250 | 500)- 10:36, 10 May 2012 Getting started with Java Jars and Classes (hist) [2,982 bytes] Benyg (Talk | contribs) (Created page with "===What is a Java Class?=== A Java class is a branch of code which be referred to by the creation of new objects in Java. From a narrow point of view it can be called a sub, but ...")
- 16:26, 24 April 2012 Max file descriptor limit (Linux) (hist) [251 bytes] Benyg (Talk | contribs) (Created page with "===Get current limit=== <pre> $ cat /proc/sys/fs/file-max 205076</pre> ===Get current number of open files=== <pre>lsof|wc -l</pre> ===Increase the max file descriptor limit=== *...")
- 10:34, 19 April 2012 Logrotate (Linux) (hist) [614 bytes] Benyg (Talk | contribs) (Created page with "The right way to logrotate, keep 14 days with helpful dates and the filenames do not change every day for your logs: <pre> /var/log/app/app.log /var/log/app/app_something.log { ...")
- 18:35, 9 March 2012 Error: Could not find/open font when opening font "xyz", using internal non-scalable font (gnuplot) (hist) [855 bytes] Benyg (Talk | contribs) (Created page with "===Symptom=== When trying to plot with gnuplot the following error can appear: <pre> Could not find/open font when opening font "xyz", using internal non-scalable font </pre> =...")
- 18:18, 9 March 2012 Use smarthost with mailx/mail (Postfix) (hist) [628 bytes] Benyg (Talk | contribs) (Created page with "The client mailer mail / [http://pubs.opengroup.org/onlinepubs/009604499/utilities/mailx.html mailx] with Postfix by default will contact the MTA directly from a MX record lookup...")
- 10:57, 9 March 2012 Simple Apache log file analyser using Awk (hist) [227 bytes] Benyg (Talk | contribs) (Created page with "Show counts of status codes: <pre>awk '{count[$9]++}END{for(j in count) print j," "count[j]" request(s)"}' access.log</pre> You may need to be change the column number - $9 - dep...")
- 10:02, 27 February 2012 Syslog (hist) [3,701 bytes] Benyg (Talk | contribs) (Created page with "Syslog is a deamon that runs on every Linux box for collecting local system messages. It can also be configured to send these messages to a remote syslog server. The syslog serve...")
- 15:48, 22 February 2012 Show trigger SQL (PostgreSQL) (hist) [92 bytes] Benyg (Talk | contribs) (Created page with "<pre> select prosrc from pg_proc where proname='triggername'; </pre> Categroy:PostgreSQL")
- 10:18, 22 February 2012 Openswan (hist) [260 bytes] Benyg (Talk | contribs) (Created page with "===Multiple Subnets=== Use the following syntax in ipsec.conf : <pre> leftsubnets={1.1.1.0/24,10.10.0.0/16} rightsubnets={2.1.1.0/24,12.12.0.0/16} </pre> This will establish sepa...")
- 17:32, 14 February 2012 Awk Tricks (hist) [925 bytes] Benyg (Talk | contribs) (Created page with "===Delete occurances of a string=== <pre>awk '{ gsub(/string/,""); print }'</pre> ===Replace text1 with text2=== <pre>awk '{ gsub(/string/,text2); print }'</pre> ===Replace text1...")
- 11:51, 26 January 2012 Bad owner name (check-names) Error (BIND) (hist) [713 bytes] Benyg (Talk | contribs) (Created page with "===Problem=== When attempting to load a xone file this error can occur: <pre> pop.company.net.zone:313: blah.pop.company.net: bad owner name (check-names) zone pop.company.net/IN...")
- 09:57, 26 January 2012 X Windows & Desktop Tricks (Linux) (hist) [869 bytes] Benyg (Talk | contribs) (Created page with "===Restart X without restarting machine=== To get a console press Ctrl + Alt + F1, depending on your desktop environment: *LightDM - Ubuntu 11.10+ <tt>sudo /etc/init.d/lightdm re...")
- 17:20, 25 January 2012 Background Writer (bgwriter) (PostgreSQL) (hist) [1,454 bytes] Benyg (Talk | contribs) (Created page with "Bgwriter (background writer) pushes buffers to disk. Backend processes handling queries never have to wait for a write to occur as bgwriter will do it first. ===Settings=== bgwri...")
- 17:18, 25 January 2012 Checkpoint (PostgreSQL) (hist) [762 bytes] Benyg (Talk | contribs) (Created page with "Checkpoint flushes all buffers to disk and deletes xlogs ===Settings=== checkpoint_timeout: Maximum allowed time since the last checkpoint. checkpoint_completion_target: Target l...")
- 17:08, 6 January 2012 TCP Connection Termination (Networking) (hist) [2,748 bytes] Benyg (Talk | contribs) (Created page with "===Normal Connection Termination=== Each side closes the connection independantly by sending a FIN packet and waiting for an ACK, 4 packets are exchanged. <pre> -------------- F...")
- 09:49, 4 January 2012 SQL Examples (hist) [3,333 bytes] Benyg (Talk | contribs) (Created page with "To join the table films with the table distributors: SELECT f.title, f.did, d.name, f.date_prod, f.kind FROM distributors d, films f WHERE f.did = d.did title ...")
- 15:06, 23 December 2011 Count Network connections by state (Linux) (hist) [471 bytes] Benyg (Talk | contribs) (Created page with "To display a count of all network connections by their state: <pre> $ sudo netstat -ant | awk '{print $6}' | sort | uniq -c | sort -n 1 established) 1 Foreign 2...")
- 15:09, 12 December 2011 Create file with exact / specific size (Linux) (hist) [145 bytes] Benyg (Talk | contribs) (Created page with "Create a 250MB (MegaByte) file with random characters: <pre>dd if=/dev/random of=250MB-file bs=1024 count=$((250*1024))</pre> Category:Linux")
- 11:26, 7 December 2011 Svn: Can't open file '/mnt/svn/dns/db/txn-current-lock': Permission denied Error (SVN) (hist) [740 bytes] Benyg (Talk | contribs) (Created page with "===Symptom=== When attempting to commit to a SVN repo with svnserve the following error can occur: <pre> svn: Can't open file 'db/txn-current-lock': Permission denied </pre> ...")
- 11:43, 2 November 2011 Block / Ban MAC address in dhcpd (Linux) (hist) [116 bytes] Benyg (Talk | contribs) (Created page with "Add to dhcpd.conf: <pre> host badguy { hardware ethernet 0:c0:c3:11:90:23; deny booting; } </pre> Category:Linux")
- 14:35, 17 October 2011 Apache Digest Authentication (hist) [1,163 bytes] Benyg (Talk | contribs) (Created page with "Check that the auth_user_module and authz_group_module are both loaded. If they are not listed add the following to your <tt>httpd.conf</tt> , otherwise you will see this error: ...")
- 09:12, 12 October 2011 Improve SNR (Networking) (hist) [961 bytes] Benyg (Talk | contribs) (Created page with "The SNR on your ADSL line in some cases can be improved: ===Negotiate a sync speed at the best time of day=== Interference...")
- 09:02, 12 October 2011 Check ADSL Line Stats (Networking) (hist) [3,516 bytes] Benyg (Talk | contribs) (Created page with "===Background=== There are four properties that determine effective speed of an ADSL line: ====Attenuation==== Line attenuation is in relation to the "loop loss" on your line fro...")
- 11:19, 6 October 2011 Copy file to multiple locations (Linux) (hist) [650 bytes] Benyg (Talk | contribs) (Created page with "===Background=== Top copy a single file to multple destinations the following might be attempted: <pre> $ cp file */ cp: omitting directory: `subdir1/' cp: omitting directory: `s...")
- 14:13, 5 October 2011 Set default value script/function parameter (Bash) (hist) [629 bytes] Benyg (Talk | contribs) (Created page with "<tt>$1</tt>, <tt>$2</tt> .. <tt>$n</tt> can be used to retrieve parameters passed to Bash scripts or functions. Default values can be assigned to these variable without the use o...")
- 14:32, 30 September 2011 View locking transactions (PostgreSQL) (hist) [413 bytes] Benyg (Talk | contribs) (Created page with "<pre> SELECT pg_class.relname, pg_locks.transactionid, pg_locks.mode, pg_locks.granted as "g", substr(pg_stat_activity.current_query,1,30), pg_stat_activity.query_start, age(now(...")
- 14:21, 30 September 2011 Group by day, week or month (PostgreSQL) (hist) [642 bytes] Benyg (Talk | contribs) (Created page with "Sum counts of an occurrence into days, weeks, or months ===Group by day=== <pre> SELECT date_trunc('day', loggedin) AS "Day" , count(*) AS "No. of users" FROM logins WHERE create...")
- 09:32, 15 September 2011 Exim (hist) [1,303 bytes] Benyg (Talk | contribs) (Created page with "Get current activity:<pre>exiwhat</pre> Count of messages in the queue: <pre> exim -bpc</pre> List details re messages in the queue: time queued, size, message-id, sender, recipi...")
- 08:12, 15 September 2011 Command substitution (BASH) (hist) [1,180 bytes] Benyg (Talk | contribs) (Created page with "Command substitution involves substituting a command with its output. This can either be directly replaced as variable substitution on the command-line or piped into a virtual fi...")
- 16:23, 9 September 2011 Writing defensive BASH scripts (hist) [2,026 bytes] Benyg (Talk | contribs) (Created page with "Any kind of script should be written to expect the unexpected, this is known as programming ''defensively''. ===Exit on error=== <pre>set -o errexit</pre> The script will exit i...")
- 08:53, 6 September 2011 Restrict management (telnet) access based on IP (Cisco) (hist) [365 bytes] Benyg (Talk | contribs) (Created page with "*Restrict management access to only 10.1.1.0/24 and 10.10.10.0/23 <pre> telnet access-group 20 access-list 20 permit 10.10.1.0 0.0.0.255 access-list 20 permit 10.10.10.0 0.0.1.25...")
- 13:37, 30 August 2011 Forward DNS traffic over SOCKS proxy (Firefox) (hist) [661 bytes] Benyg (Talk | contribs) (Created page with "By default Firefox when using a socks proxy will still use the local DNS configuration before forwarding traffic to the proxy. This can have some drawbacks: *Site being accessed ...")
- 09:59, 29 July 2011 Python script fails with ": command not found" (hist) [488 bytes] Benyg (Talk | contribs) (Created page with "===Problem=== When running a Python script it fails with the following output: <pre>: command not found</pre> ===Cause=== as it appears - this is a path issue. Python scripts hav...")
- 08:54, 29 July 2011 Page not found (hist) [199 bytes] Benyg (Talk | contribs) (Created page with "The page you are looking cannot be found! Please try one of the following pages: *Linux *Windows *Web *[[Category:Ex...")
- 13:50, 26 July 2011 Remove sticky tags (CVS) (hist) [527 bytes] Benyg (Talk | contribs) (Created page with "CVS can use sticky tags, which has similar functionality to a branch in that it creates a separate working copy to each revision. It can cause an error: <pre> cvs commit: sticky ...")
- 15:34, 25 July 2011 Find duplicate PTRs in a zone file (hist) [450 bytes] Benyg (Talk | contribs) (Created page with "For any RFC compliant reverse zone file including BIND / named, where the first field is the last octet: <pre>for i in `egrep '^[0-9]{1,3}' reverse.rev | awk '{print $1}' | sort ...")
- 14:54, 20 July 2011 Possible SYN flooding on port xxx. Sending cookies (Linux) (hist) [1,101 bytes] Benyg (Talk | contribs) (Created page with "===Symptom=== <tt>dmesg</tt> shows that possible SYN flooding is occurring: <pre> $ dmesg ....... possible SYN flooding on port xxx. Sending cookies. possible SYN flooding on por...")
- 15:05, 18 July 2011 Sourcing variables from other files using Source command (Linux) (hist) [613 bytes] Benyg (Talk | contribs) (Created page with "When a child process is started from a BASH script any evironment variables are lost created or changed in the child are ''lost''. If the process or script is called using the so...")
- 09:13, 8 July 2011 Extract IP address from string using grep (hist) [270 bytes] Benyg (Talk | contribs) (Created page with "<tt>-o</tt> option tells grep to only print the parts that match the grep <pre> $ host yahoo.com | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' 209.191.122.70 67.195.160.76 69.147.125....")
- 10:45, 15 June 2011 Ascertain what package provides a given binary with rpm (Linux) (hist) [279 bytes] Benyg (Talk | contribs) (Created page with "On Redhat-based systems the ''rpm'' command can show the package that installs a given binary. This is useful when a given binary is not present on a server and <tt>yum search</t...")
- 16:28, 16 April 2011 Parameters (Perl) (hist) [156 bytes] Benyg (Talk | contribs) (Created page with "The @ARGV array stores parameters. Display the 2nd parameter:<pre>$ARGV[1]</pre> Display the number of parameters passed:<pre>@ARGV</pre> Category:Perl")
- 16:25, 16 April 2011 Subs (Perl) (hist) [267 bytes] Benyg (Talk | contribs) (Created page with "<pre> sub transform { say "Frist variable $_[0]\nSecond variable $_[1]"; } &transform; #call sub &transform(arg1, arg2); #call sub with params </pre> ===See Also=== [[Callin...")
- 16:23, 16 April 2011 Transforming text (Perl) (hist) [558 bytes] Benyg (Talk | contribs) (Created page with "*These can be used within a string: <tt>"\Lall text is lowercase"</tt> Or just before a variable: <tt>\U$varisuppercase</tt> *Set first character to be uppercase: <tt>$firstinupp...")
- 16:21, 16 April 2011 Numeric and String comparison (Perl) (hist) [768 bytes] Benyg (Talk | contribs) (Created page with "===Numeric comparison=== {| {{table}} | ==||Equal to |- | !=||Not Equal to |- | >||Greater than |- | <||Less than |- | >=||Greater than or Equal to |- | <=||Less than or Equal to...")
- 16:20, 16 April 2011 Extracting text (Perl) (hist) [562 bytes] Benyg (Talk | contribs) (Created page with "The <tt>split()</tt> function gives [http://www.gnu.org/manual/gawk/html_node/Cut-Program.html cut] functionality to Perl. <br>Usage: <tt>split('delimeter',input,max_no_of_fields...")
- 16:19, 16 April 2011 Associative Arrays (Perl) (hist) [327 bytes] Benyg (Talk | contribs) (Created page with "<pre> my %splitfilenames (1, "allpics.aa", 2, "allpics.ab", 3, "allpics.ac", 4, "allpics.ad", 5, "allpics.ae"); </pre> To add a single value at a time (useful in loop...")
- 16:11, 16 April 2011 Loops (Perl) (hist) [735 bytes] Benyg (Talk | contribs) (Created page with "===For loops (indices)=== Indices should be avoided in Perl, as better alternatives exist <pre> my $pagecount = 20; my @onetopagecount = (1 .. $pagecount); for my $i (@onetopagec...")
- 16:08, 16 April 2011 Calling subs from separate script (Perl) (hist) [1,002 bytes] Benyg (Talk | contribs) (Created page with "To better organise your code or to allow code to be referred to by multiple scripts it can be best to call the code, which is a sub in this example, from a separate perl script. ...")
- 14:23, 15 April 2011 Ping: icmp open socket: Operation not permitted (hist) [703 bytes] Benyg (Talk | contribs) (Created page with "===Problem=== Unless you are root, ping shows the following error message: <pre> [user@host]$ ping 1.1.1.1 ping: icmp open socket: Operation not permitted </pre> ===Cause=== On ...")
- 18:17, 13 April 2011 Get Hard disk manufacturer and model (Linux) (hist) [309 bytes] Benyg (Talk | contribs) (Created page with "To obtain detailed information on the hard drives installed <tt>sdparm</tt> or <tt>hdparm</tt> can be used. Manufacturer, model, serial number and size as well as other informati...")