Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

{Linux} Tips and Tricks.

TTY with a background image. Yung scripts nan doon sa image...Need nyo yung FBTERM and FBV package..

attachment.php


- - - Updated - - -

May bug itong script na ito starting with debian 7.. First attemp nito from boot tatabunan ulit ng tty screen yung background, then i will press ctrl+d to kill the fbterm and execute ulit yung script at mag di-display na ng maayos...Hope may solution itong bug na ito.
 

Attachments

  • jer1.png
    jer1.png
    229.9 KB · Views: 67
Last edited:
Fbi will not work with tmux or screen, so just use fim as your image viewer inside tty.

Some nice fim's effects with an option of -t
Code:
fim -t <image file>

- - - Updated - - -

attachment.php
 

Attachments

  • jer.png
    jer.png
    20.3 KB · Views: 62
Mabubuhay na ako without flashplugin-nonfree packages dahil yung youporn.com, redtube.com, spankwire.com, pornhub.com, xtube.com, extremetube.com and youtube.com pwede na with html5....Yung ibang site download ko nalang using clive or youtube-dl....

- - - Updated - - -

lalakwe kasi tyo pasinsya na...But this is still a linux tips..

- - - Updated - - -

note: Disabled or uninstall all flash plugin including swfdec-mozilla pag meron inorder yung html5 will work on the above sites..

- - - Updated - - -

Ito nalang kasi yung nonfree item ko...At last im free hehehehehe!
 
Last edited:
This is how I monitor my dropbox and apache2-mysql server with the absent of icon and desktop ..

dropboxstatus script
Code:
#!/bin/bash/
echo Dropbox:$(python /home/jer/.dropbox.py filestatus ~/Dropbox/ | cut -d : -f 2)
echo Mysql:$(sh /home/jer/scripts/nm_dropbox/serverstatus)
exit
serverstatus script
Code:
#/bin/bash/

STATUS=`ps nc -C apache2 | wc -l`
if [ $STATUS = "1" ]; then
    echo ' Disabled' 
else
    echo ' Running'
fi

Ito yung tatawag sa dalawang scripts above
Code:
#/bin/bash/
while true; do tput clear; sh /home/jer/scripts/nm_dropbox/dropboxstatus; sleep 20; done

Yung result sa script above ay nasa bottom right ng image below.

attachment.php


- - - Updated - - -

kailangan i monitor kasi heavy weight tung mga ito.. So ondemand sila, kung kailangan gagamitin then tatawagin ko via script.

- - - Updated - - -

@muthym

I have a 100 lines of text in a one text file. Ang tanong paano ko to ma display in a terminal one of a time. 50 lines per page yung bawat display?..Parang next and previous page ang dating(pagination).. I like to use bash scripts..

In short paano ba yung pagination with bash script?
 

Attachments

  • jer.png
    jer.png
    9.6 KB · Views: 53
Last edited:
@muthym

I have a 100 lines of text in a one text file. Ang tanong paano ko to ma display in a terminal one of a time. 50 lines per page yung bawat display?..Parang next and previous page ang dating(pagination).. I like to use bash scripts..

In short paano ba yung pagination with bash script?

* you can use your favorite programming language (an interpreter) & call it via bash/terminal. In my case, madali para sa'kin gawin sa BASIC, madaling i-manipulate.
* you can use bash script itself. gaya ng sinasabi mo.
* or simply LESS or head/tail. ayaw mo? :)

I made one (using MicroCore shell) pero di pa 'to mismo. Kuha ka na lang ng idea kung meron :) Update ko na lang 'to pagmagka-time.

Code:
#!/bin/sh
echo "Filename:$1"
n=`wc -l < $1`
echo "Number of lines:$n"

ctr=1
while read line
do
  echo "$ctr) $line"
  if [ `expr $ctr % 5` -eq 0 ]
    then
      echo "_oOo_"
  fi
  ctr=`expr $ctr + 1`
done < $1

To execute:

chmod +x view

./view [filename]

-> if the script filename is view.
 
Last edited:
* you can use your favorite programming language (an interpreter) & call it via bash/terminal. In my case, madali para sa'kin gawin sa BASIC, madaling i-manipulate.
* you can use bash script itself. gaya ng sinasabi mo.
* or simply LESS or head/tail. ayaw mo? :)

I made one (using MicroCore shell) pero di pa 'to mismo. Kuha ka na lang ng idea kung meron :) Update ko na lang 'to pagmagka-time.

Code:
#!/bin/sh
echo "Filename:$1"
n=`wc -l < $1`
echo "Number of lines:$n"

ctr=1
while read line
do
  echo "$ctr) $line"
  if [ `expr $ctr % 5` -eq 0 ]
    then
      echo "_oOo_"
  fi
  ctr=`expr $ctr + 1`
done < $1

To execute:

chmod +x view

./view [filename]

-> if the script filename is view.

Maganda kasi yung pagination ng tce-ab with tinycore, na numbered yung item then type n for next page, p for previous page and type the number to select the item. Applicable kasi yun with POS, Ganda simpleng simple..
 
Maganda kasi yung pagination ng tce-ab with tinycore, na numbered yung item then type n for next page, p for previous page and type the number to select the item. Applicable kasi yun with POS, Ganda simpleng simple..

I see... eto pala tinutukoy mo.

Nakita mo na ba yung script ng tce-ab? Teka i-post ko...

Request ko pala, pwede mo bang i-post yung screenshot ng pagination na tinutukoy mo sa TinyCore.

- - - Updated - - -

Code:
#!/bin/sh
# Tiny Core Browser
# (c) Robert Shingledecker 2009-2012
. /etc/init.d/tc-functions
trap 'echo && exit 1 1>&2' 1 2 15

searchInfoList() {
	clear
	if [ ! -n "$ITEM" ] || [ ${ITEM:0:1} == "-" ]; then
		echo -n "Enter starting chars of desired extension, e.g. abi: "; read ITEM
		[ ! -n "$ITEM" ] && quit
	fi
	search.sh "$ITEM" > info.lst
}

whatProvides() {
	clear
	if [ ! -n "$ITEM" ] || [ ${ITEM:0:1} == "-" ]; then
		echo -n "Enter search term, e.g. iwconfig: "; read ITEM
		[ ! -n "$ITEM" ] && quit
	fi
	provides.sh "$ITEM" > info.lst
}
 
keywordSearch() {
	clear
	if [ ! -n "$ITEM" ] || [ ${ITEM:0:1} == "-" ]; then
		echo -n "Enter search term(s), e.g. browser: "; read ITEM
		[ ! -n "$ITEM" ] && quit
	fi
	search.sh -t "$ITEM" > info.lst
}

selectItem(){
	select "tce - Tiny Core Extension browser" info.lst
	EXTN="$(cat /tmp/select.ans)"
	[ "$EXTN" == "q" ] && unset EXTN
}

displayInfo(){
	if [ -n "$EXTN" ]; then
		tce-fetch.sh "$EXTN".info
		less "$EXTN".info
		rm "$EXTN".info
	fi
}

displayDepends(){
	tce-fetch.sh "$EXTN".dep
	less "$EXTN".dep
	rm "$EXTN".dep
}

displayTree(){
	tce-fetch.sh "$EXTN".tree
	less "$EXTN".tree
	rm "$EXTN".tree
}

displaySize(){
	clear
	tce-size "$EXTN"
}

displayFiles(){
	tce-fetch.sh "$EXTN".list
	less "$EXTN".list
	rm "$EXTN".list
}

quit(){
	rm -f info.lst* /tmp/tags.lst /tmp/select.ans > /dev/null
	cd - > /dev/null
	rm -rf $TMPDIR 2>/dev/null
	exit 0
}

# Main
checknotroot
TMPDIR=`mktemp -d -t`
cd $TMPDIR
clear
echo "tce-ab - Tiny Core Extension: Application Browser"
echo
while true; do
	[ -n "$EXTN" ] && echo -e "\033[40;37;7m $EXTN \033[0m" && echo -n "A)bout I)nstall O)nDemand D)epends T)ree F)iles siZ)e L)ist "
	echo -n "S)earch P)rovides K)eywords or Q)uit: "; read -s -n1 ANS; echo
	case ${ANS} in
		A|a) displayInfo ;;
		I|i) tce-load -w -i "$EXTN" ;;
		O|o) tce-load -w -o "$EXTN" ;;
		D|d) displayDepends ;;
		T|t) displayTree ;;
		Z|z) displaySize ;;
		F|f) displayFiles ;;
		L|l) selectItem ;;
		S|s) ITEM="" && searchInfoList "$ITEM" && selectItem; displayInfo ;;
		P|p) ITEM="" && whatProvides "$ITEM" && selectItem; displayInfo ;;
		K|k) ITEM="" && keywordSearch "$ITEM" && selectItem; displayInfo ;;
		Q|q) quit ;;
		*) ;; #displayInfo ;;
	esac
done

Eto yung logic ni Shingledecker. I don't know, kung eto rin mismo yung gusto mong mangyari sa script na gusto mong gawin. I had one in my mind. Initially, i posted the script. I'll try to finish it. It's nice that you've opened the subject :) I'm not that exposed in scripting. Tinatamad na kasi ko pag-scripting na:) Since, eto yung lacking sa mga gustong mag-aral ng linux dahil sa pagiging dependent sa GUI, I'm willing to share at i-apply yung nalalaman ko sa ibang proglang para sa Unix/Linux scripting. I hope makatulong din yung mga guru sa Linux scripting dito.

Sa mga beginners, nakakalitong tignan kung babasahin nila yung script. Pero kung iintindihin nila yung syntax, madali na lang.

I'll use sh (bourne shell) instead of bash (bourne-again shell).
 
Last edited:
Request ko pala, pwede mo bang i-post yung screenshot ng pagination na tinutukoy mo sa TinyCore.

I start to like bash/sh, kasi ito yung default scripting language ng Unix. So why install third party language for standalone program kung nandoon na yung bash.

Ito kasi yung na observed ko. Yung mga text mode program na gumagamit ng ncurses like MC,TMUX etc may problema sometimes doon sa ibang distro.. Itong MC di masyado maganda yung rendering nya inside TMUX dyan sa tiny core ko(need to export TERM) but dito sa debian okay naman.

Ito yun muth
attachment.php
 

Attachments

  • jershot.png
    jershot.png
    2.5 KB · Views: 49
Last edited:
mga sir pano po paganahin yung FN+Brightness sa linux mint? Natry ko na iedit yung grub tapos yung xbacklight ayaw pa rin. Sakit sa mata :weep:
 
I start to like bash/sh, kasi ito yung default scripting language ng Unix. So why install third party language for standalone program kung nandoon na yung bash.

Sa case ko, for MicroCore, sh (bourne shell) ang default. Kaya ang bash ay third-party na sa akin. This is one reason.

I love BASIC language. Sa beginner na magma-migrate sa Linux, pwede nila gamitin yung programming language na alam nila at hanapan nila ang katumbas nito sa Linux. At pwede mismo sila gumawa ng script mismo gamit yung language na 'yon. Ang mairerekomenda ko sa kanila ay BASIC language para madaling intindihin dahil pang-beginners talaga. Gaya na na-i-post ko...
* you can use your favorite programming language (an interpreter) & call it via bash/terminal. In my case, madali para sa'kin gawin sa BASIC, madaling i-manipulate.
* you can use bash script itself. gaya ng sinasabi mo.
* or simply LESS or head/tail. ayaw mo?

... isang way na yung una kong nilagay (in *), kung gagawin nila yung tanong mo about sa pagination sa language na alam nila. Here's my example:

Code:
#!/usr/local/bin/sbasic
tload "linux",ln
while true
  input "Enter page #:",p
  n=(p-1)*5
  for c=0 to 4    
    l=ln(n+c)
    if empty(l) then
      exit
    end if
    color 10
    print space(5);n+c+1;") ";ln(n+c)
    color 7
  next
wend

View attachment 170170

I used SmallBASIC dahil walang ganong dependencies at lightweight na rin. This is not my programming language. Naghanap lang ako ng interpreter para makagawa ako ng script para ma-apply ko yung nalalaman kong BASIC language galing sa ibang OS (DOS/Windows).

Now, ang gagawin ko, kung maisipan ko naman na gamitin ang native scripting language ng distro na ginagamit ko at naboboring na ako sa paggamit ng BASIC, pwede na akong mag-jump sa scripting na meron ang distro ko (pwede ring awk). So, ayun yung second option na pinost ko, na gusto mong gawin which is yung bash (bourne-again shell) nga. But in my case, sa sh ko gagawin. Compatible naman sila pero... Hindi bash to sh. sh to bash - Oo, base sa mga case na ginagawa ko kung saan meron akong gagawin na nagwo-work sa bash pero hindi sa sh.

Lastly, for me which is simple wherein i-a-access ko lang sa command line yung binanggit ko sa third item sa list na pinost ko, yung less, head & tail commands.

View attachment 170174

Ito kasi yung na observed ko. Yung mga text mode program na gumagamit ng ncurses like MC,TMUX etc may problema sometimes doon sa ibang distro.. Itong MC di masyado maganda yung rendering nya inside TMUX dyan sa tiny core ko(need to export TERM) but dito sa debian okay naman.

Meron din akong case na na-encounter, nagkakaproblem rin paggumagamit ng ganito, ang akin naman dvtm ang gamit ko while trying the output of smallbasic script. What I did, inexecute ko yung GNU SCREEN sa loob ng dvtm. umOkay naman. Kaya hindi rin ako gumagamit ng MC dahil sa dependencies sa ginagamit kong distro. I use fdclone instead. But most of the time DVTM at command-line, ayos na. may file manager na ako. Sabi mo nga, bat ka pa gagamit ng third party kung meron naman default yung distro na ginagamit mo, diba? :)



Salamat dito :)
 

Attachments

  • sbscript.jpg
    sbscript.jpg
    36.9 KB · Views: 6
  • lessheadtail.jpg
    lessheadtail.jpg
    22.9 KB · Views: 6
Last edited:
Sa case ko, for MicroCore, sh (bourne shell) ang default. Kaya ang bash ay third-party na sa akin. This is one reason.

I love BASIC language. Sa beginner na magma-migrate sa Linux, pwede nila gamitin yung programming language na alam nila at hanapan nila ang katumbas nito sa Linux. At pwede mismo sila gumawa ng script mismo gamit yung language na 'yon. Ang mairerekomenda ko sa kanila ay BASIC language para madaling intindihin dahil pang-beginners talaga. Gaya na na-i-post ko...


... isang way na yung una kong nilagay (in *), kung gagawin nila yung tanong mo about sa pagination sa language na alam nila. Here's my example:

Code:
#!/usr/local/bin/sbasic
tload "linux",ln
while true
  input "Enter page #:",p
  n=(p-1)*5
  for c=0 to 4    
    l=ln(n+c)
    if empty(l) then
      exit
    end if
    color 10
    print space(5);n+c+1;") ";ln(n+c)
    color 7
  next
wend

View attachment 925142

I used SmallBASIC dahil walang ganong dependencies at lightweight na rin. This is not my programming language. Naghanap lang ako ng interpreter para makagawa ako ng script para ma-apply ko yung nalalaman kong BASIC language galing sa ibang OS (DOS/Windows).

Now, ang gagawin ko, kung maisipan ko naman na gamitin ang native scripting language ng distro na ginagamit ko at naboboring na ako sa paggamit ng BASIC, pwede na akong mag-jump sa scripting na meron ang distro ko (pwede ring awk). So, ayun yung second option na pinost ko, na gusto mong gawin which is yung bash (bourne-again shell) nga. But in my case, sa sh ko gagawin. Compatible naman sila pero... Hindi bash to sh. sh to bash - Oo, base sa mga case na ginagawa ko kung saan meron akong gagawin na nagwo-work sa bash pero hindi sa sh.

Lastly, for me which is simple wherein i-a-access ko lang sa command line yung binanggit ko sa third item sa list na pinost ko, yung less, head & tail commands.

View attachment 925156



Meron din akong case na na-encounter, nagkakaproblem rin paggumagamit ng ganito, ang akin naman dvtm ang gamit ko while trying the output of smallbasic script. What I did, inexecute ko yung GNU SCREEN sa loob ng dvtm. umOkay naman. Kaya hindi rin ako gumagamit ng MC dahil sa dependencies sa ginagamit kong distro. I use fdclone instead. But most of the time DVTM at command-line, ayos na. may file manager na ako. Sabi mo nga, bat ka pa gagamit ng third party kung meron naman default yung distro na ginagamit mo, diba? :)




Salamat dito :)

Hahahahaha sa buong akala ko yung sh same lang sa bash(Bourne-Again Shell), di pa la....

- - - Updated - - -

Yung una kung multiflixer ay screen. But the latest debian medyo di maganda yung elinks with screen..At di ko maiiwanan si elinks dahil ito lang yung makkapagbigay sa akin ng gusto ko.. So i use tmux ngayon..

- - - Updated - - -

Tmux + screen(inside a pane of tmux).

- - - Updated - - -

mga sir pano po paganahin yung FN+Brightness sa linux mint? Natry ko na iedit yung grub tapos yung xbacklight ayaw pa rin. Sakit sa mata :weep:

Try mo to:
--doon sa /etc/default/grub na file
------Edit mo yung line na satrting with "GRUB_CMDLINE_LINUX_DEFAULT="quite ......"
---------add mo to
Code:
acpi_osi=Linux acpi_backlight=vendor

so sa case ko na pure debian ito yung result
GRUB_CMDLINE_LINUX_DEFAULT="quite acpi_osi=Linux acpi_backlight=vendor"

then save the file grub

and execute this so that it will make a new grub.cfg doon sa boot dir.
Code:
sudo update-grub

Make sure yung xfce4-power-manager naka enable..
 
Salamat sir jan but I've already tried that and didn't work. Eto yung nahanap kong workaround para maadjust yung brightness echo 488 > /sys/class/backlight/intel_backlight/brightness .
 
Salamat sir jan but I've already tried that and didn't work. Eto yung nahanap kong workaround para maadjust yung brightness echo 488 > /sys/class/backlight/intel_backlight/brightness .

Okay...Good for you!

- - - Updated - - -

Magagamit mo ba yung fn+up/down to adjust the brightness?

- - - Updated - - -

Iba iba kasi yung mag wo-work bawat hardware and OS..Yung naibigay ko syo previous mag wo-work yan with my samsung(debian-openbox) and lenovo(debian-lxde) using my fn+up/down.

Meron akong ibang paraan doon sa walang desktop kung papaano adjust yung brightness
Code:
sudo setpci -s 00:02.0 F4.B=20

note yung 20 means 20% brightness.
 
Okay...Good for you!

- - - Updated - - -

Magagamit mo ba yung fn+up/down to adjust the brightness?

- - - Updated - - -

Iba iba kasi yung mag wo-work bawat hardware and OS..Yung naibigay ko syo previous mag wo-work yan with my samsung(debian-openbox) and lenovo(debian-lxde) using my fn+up/down.

Meron akong ibang paraan doon sa walang desktop kung papaano adjust yung brightness
Code:
sudo setpci -s 00:02.0 F4.B=20

note yung 20 means 20% brightness.

Nope di siya adjustable via keyboard pero ayos lang. Di rin nagwork sakin yung setpci. Salamat sir :salute:
 
Nope di siya adjustable via keyboard pero ayos lang. Di rin nagwork sakin yung setpci. Salamat sir :salute:

you're welcome! Pwede mo yun gagawan ng script yung nag wowork na changing your intel/brightness sa sys/ dir value then i assign mo yung keyboard shortcut, para makaa adjust ka on fly..

Ito yung bright script ko..Just replace the setpci with your working command then gawin mong executable at ilagay mo sa /usr/local/bin yung file

Code:
#!/bin/bash

if [ $1 -lt 100 ] && [ $1 -gt 0 ]; then
sudo setpci -s 00:02.0 F4.B="$1"
else
echo "Only numeric value between 1 and 99 are allowed."
fi

To execute it
bright <desired numerical percentage for brightness>
ex. bright 55 then press enter.
 
Last edited:
you're welcome! Pwede mo yun gagawan ng script yung nag wowork na changing your intel/brightness sa sys/ dir value then i assign mo yung keyboard shortcut, para makaa adjust ka on fly..

Ito yung bright script ko..Just replace the setpci with your working command then gawin mong executable at ilagay mo sa /usr/local/bin yung file

Code:
#!/bin/bash

if [ $1 -lt 100 ] && [ $1 -gt 0 ]; then
sudo setpci -s 00:02.0 F4.B="$1"
else
echo "Only numeric value between 1 and 99 are allowed."
fi

To execute it
bright <desired numerical percentage for brightness>
ex. bright 55 then press enter.

Woah. Noob pa lang ako sir sa linux. Pano po siya gawing executable?
 
Last edited:
Woah. Noob pa lang ako sir sa linux. If I'm not mistaken Perl script yan? Pano po siya gawing executable?

chmod +x <yung file mo>

- - - Updated - - -

try mo...May kakilala ako dito na mga LINUX girls sina prescilla at sumner... Hope you will be the third linux girl.. Bihira lang kasi yung girl na nag lilinux, kaya nga-nga ako syo...hehehe joke lang..
 
Hehe. Mahilig lang talaga ako sir sa command line. It makes me feel like a wizard. :lolcard:

May major problem pa ako sir. Di ko maaccess ang mga https sites after I log in. I get the same problem with the other distros unlike Windows. Baka lang sir may masuggest kang solution.
 
Hehe. Mahilig lang talaga ako sir sa command line. It makes me feel like a wizard. :lolcard:

May major problem pa ako sir. Di ko maaccess ang mga https sites after I log in. I get the same problem with the other distros unlike Windows. Baka lang sir may masuggest kang solution.

masarap yung commandline dahil alam na natin yun na ang pinaka dulo(core). Simplicity is beauty.

Anong browser yung ginagamit mo..Pwede give me sample site na https na di mo napapasok?
 
masarap yung commandline dahil alam na natin yun na ang pinaka dulo(core). Simplicity is beauty.

Anong browser yung ginagamit mo..Pwede give me sample site na https na di mo napapasok?

FF, Chrome, Opera browsers sir di lahat makaaccess. fb, gmail, ymail. Ganun din actually sa android tablet ko, linux-based naman. Sa Windows wala namang problema.
 
Back
Top Bottom